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, production"  

This is good on build side of things, but not at the go code side. As soon 
as I send to build process, we do fmt, lint etc, the "go fmt" removes the 
2nd tag and then the symbols in go file is not found. 
Best Regards,
Sandeep
On Friday, November 11, 2022 at 3:16:02 PM UTC-6 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: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 production,linux
>
> package main
> ```
> - sean
>
>
> On Fri, Nov 11, 2022 at 9:13 PM Sandeep Kalra <sandee...@gmail.com> wrote:
>
>> 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  <<<<<< Notice This Line as my production code is only 
>>> available on Linux
>>>
>>> package main
>>>
>>> const (
>>>     isProductionCode = true
>>>     isDebugCode      = false
>>> )
>>>
>>> $ go fmt production.go
>>> production.go
>>> $ cat production.go
>>> //go:build production
>>> // +build production
>>>
>>> package main
>>>
>>> const (
>>>     isProductionCode = true
>>>     isDebugCode      = false
>>> )
>>> Thanks,
>>> Sandeep Kalra
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to golang-nuts...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/9a4b4e5d-4c3f-469d-8cc5-6a268152cd5an%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/golang-nuts/9a4b4e5d-4c3f-469d-8cc5-6a268152cd5an%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/eac08e40-ec84-47b3-a54f-a305c6aedb04n%40googlegroups.com.

Reply via email to