How to solve this problem?
$ go build -gcflags='all -N -l' main.go
invalid value "all -N -l" for flag -gcflags: missing =<value> in <pattern>=<value>
usage: go build [-o output] [-i] [build flags] [packages]
Run 'go help build' for details.
Follow the instructions in the error message.
Run 'go help build' for details.
$ go help build
<<SNIP>>
The -asmflags, -gccgoflags, -gcflags, and -ldflags flags accept a
space-separated list of arguments to pass to an underlying tool
during the build. To embed spaces in an element in the list, surround
it with either single or double quotes. The argument list may be
preceded by a package pattern and an equal sign, which restricts
the use of that argument list to the building of packages matching
that pattern (see 'go help packages' for a description of package
patterns).
<<SNIP>>
Follow the instructions in the help text precisely.
The argument list may be preceded by a package pattern and an equal
sign.
For example, for package patterm all
: all=
.
go build -gcflags='all=-N -l' main.go
References:
Command go: Compile packages and dependencies