On Mar 26, 2014 11:45 PM, <dtne...@gmail.com> wrote:
>
> Hi all,
>
> I'm a new developer in Go. I am a grad student in computational science and I'm working on creating a library for local search in Go. I know that if I want to pass in a flag such as "race" to the compiler, i can run my Go program with "go build -gcflags '-race' myprogram.go". But I am trying to figure out how to pass in multiple flags. I looked at the compiler code and couldn't find it. I'll search more, but i figure that someone here is likely to know the quick answer.
-gcflags "-l -m"
> The reason I am doing this is because I modified the compiler source code so that I can disable errors from unused variables, which makes developing much faster for me. I understand why unused variables are a bad idea, so I only want this as a compiler option, therefore my need for passing in flags. So for example, I'll run my program with "go build -gcflags '-unused_vars_ok' myprogram.go", and it won't give me errors for unused variables. However, I'd like to extend this so that I can also ignore unused imported packages, but first i need to figure out how to pass in multiple flags :)
this is highly discouraged. I'd go so far as to say that disable that feature means you're not using Go.