[go-nuts] is this a bug in "go fmt"?

2022-11-11 Thread Sandeep Kalra
roduction.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 unsubscr

[go-nuts] Re: is this a bug in "go fmt"?

2022-11-11 Thread Sandeep Kalra
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

Re: [go-nuts] Re: is this a bug in "go fmt"?

2022-11-11 Thread Sandeep Kalra
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 wrote: > >> and similar issue with o

Re: [go-nuts] Re: is this a bug in "go fmt"?

2022-11-11 Thread Sandeep Kalra
ction && linux >> // +build production,linux >> >> package main >> ``` >> - sean >> >> >> On Fri, Nov 11, 2022 at 9:13 PM Sandeep Kalra >> wrote: >> >>> and similar issue with other style of adding tags as we

Re: [go-nuts] Re: is this a bug in "go fmt"?

2022-11-11 Thread Sandeep Kalra
t;>> ``` >>>> main » cat main.go >>>> // +build production >>>> // +build linux >>>> >>>> package main >>>> >>>> 21:13:35 ~/tmp/testrepo0017 0:00:00 >>>> main » go fmt . >>>> main

[go-nuts] []byte to func

2017-03-20 Thread Sandeep Kalra
Is there any option to convert []byte to func (Assuming that []byte carries valid function) package main import ( "fmt" "io/ioutil" ) func run(b []byte) { /// HERE ? } func main() { if b, e := ioutil.ReadFile("./file.go"); e != nil { fmt.Println(e) } else {

Re: [go-nuts] []byte to func

2017-03-20 Thread Sandeep Kalra
; > > On Mon, Mar 20, 2017 at 7:57 PM, Sandeep Kalra > wrote: > >> Is there any option to convert []byte to func (Assuming that []byte >> carries valid function) >> >> package main >> >> import ( >> "fmt" >>

Re: [go-nuts] []byte to func

2017-03-20 Thread Sandeep Kalra
Thanks Harley. I will pick your example and will see if this is do-able... Sandeep Best Regards, Sandeep Kalra On Mon, Mar 20, 2017 at 11:48 PM, Harley Laue wrote: > I have some code that I've sat on for some time: > > type Cell int > type Function func() error > >

[go-nuts] Is renewal of expired context possible?

2019-05-05 Thread sandeep . kalra
Hi, Is there a way to renew a context that has already reached a deadline? package main import ( "context" "fmt" "time" ) func sleepAndPrint(ctx context.Context, msg <-chan string, b <-chan bool) { for { select { case <-ctx.Done(): fmt.Println("

Re: [go-nuts] Is renewal of expired context possible?

2019-05-06 Thread sandeep . kalra
Thanks for confirming. On Monday, May 6, 2019 at 6:16:49 PM UTC-4, Ian Lance Taylor wrote: > > On Sun, May 5, 2019 at 11:13 AM > > wrote: > > > > Hi, Is there a way to renew a context that has already reached a > deadline? > > No, sorry. > > Ian > -- You received this message because you