Yep, works like a charm. thx!
On Mon, Nov 13, 2023 at 4:34 AM Michel Levieux
wrote:
> Hi!
>
> Not an expert at all, but it seems the format is
> "package-qualified.identifier=value", with value being able to just contain
> spaces out of the box, so running:
>
> go run -ldflags="-X 'main.MyVar=th
Hi!
Not an expert at all, but it seems the format is
"package-qualified.identifier=value", with value being able to just contain
spaces out of the box, so running:
go run -ldflags="-X 'main.MyVar=this is a string'" main.go
works for me. Note that for parsing the whole thing correctly, the whole
go run command-line-arguments
-X definition
add string value definition of the form importpath.name=value
I used to use this to override my variable values, in the form of
go run -ldflags="-X main.var1=val1 main.var2=val2"
Now, the new problem is that I need to have space in the strin