Thanks, sorted out.
this works!
//go:build debug || linux_debug || darwin_debug || darwin
// +build debug linux_debug darwin_debug darwin
On Friday, November 11, 2022 at 3:50:23 PM UTC-6 harr...@spu.edu wrote:
> I think the result of the proposal explains some rewriting in .go files,
> at lea
I think the result of the proposal explains some rewriting in .go files, at
least.
I believe the conventional wisdom/best practices here are:
- Use separate, parallel files to hold platform- (or tag-) specific code,
e.g:
init_darwin.go, init_linux.go, init_windows.go
- Prefer setting envir
probably yes - the implementation of tools for this feature.
If you see the accepted proposal there is this example:
https://go.googlesource.com/proposal/+/master/design/draft-gobuild.md
// +build 386 windows,amd64 windows
BTW, I am on go1.19.3.
On Friday, November 11, 2022 at 3:18:44 PM UTC-6
Hi, I will try to explain:
so, I have to run my code at 3 places : linux, windows and darwin. and On
each platform there is a production and debug code.
To make this happen, i am using build tags.
for e.g. to make build for linux in production, the script will use this:
go build --tags "linux, pr
Is this relevant? https://github.com/golang/go/issues/41184
On Friday, November 11, 2022 at 1:16:02 PM UTC-8 se...@liao.dev wrote:
> You'll need to provide more info if you want to report a bug:
>
> ```
> main » cat main.go
> // +build production
> // +build linux
>
> package main
>
> 21
You'll need to provide more info if you want to report a bug:
```
main » cat main.go
// +build production
// +build linux
package main
21:13:35 ~/tmp/testrepo0017 0:00:00
main » go fmt .
main.go
21:13:39 ~/tmp/testrepo0017 0:00:00
main » cat main.go
//go:build production && linux
// +build prod
and similar issue with other style of adding tags as well
i.e.
// +build tag1,tag2
// +build tag1 tag2
etc
On Friday, November 11, 2022 at 3:07:40 PM UTC-6 Sandeep Kalra wrote:
> Original code:
>
> $ cat production.go
>
> //go:build production
> // +build production
> // +build linux << No