[go-nuts] Re: wording in Go tour, methods/19

2020-04-15 Thread Volker Dobler
On Wednesday, 15 April 2020 17:58:11 UTC+2, Marvin Renich wrote: > > In the Go tour at https://tour.golang.org/methods/19 it says > > The error type is a built-in interface similar to fmt.Stringer: > > The words closest to "similar to" are "built-in interface", implying > that the way error is

Re: [go-nuts] Possible to make go not touch the built file if it builds purely from cache?

2020-04-15 Thread Glen Huang
Thanks, as mentioned in the previous reply, this is what I end up using. On Thursday, April 16, 2020 at 10:25:03 AM UTC+8, Shulhan wrote: > > > > On 15 Apr 2020, at 18.55, Glen Huang > > wrote: > > > > I have a makefile where upon a new go binary being built, it builds some > other stuff that

Re: [go-nuts] Possible to make go not touch the built file if it builds purely from cache?

2020-04-15 Thread Personal
> On 15 Apr 2020, at 18.55, Glen Huang wrote: > > I have a makefile where upon a new go binary being built, it builds some > other stuff that is not go related. > > The go binary is unconditionally built with a FORCE prerequisite, so the go > build command always runs, but that command alway

Re: [go-nuts] Possible to make go not touch the built file if it builds purely from cache?

2020-04-15 Thread Glen Huang
I end up using "go list" to list dependencies, and rely on the makefile to cache builds, for the binary runs in docker and the host machine is a Mac, and cross compiling with race detector enable doesn't seem to easy in this case. Previously I had to give race detector up to use go build directl

[go-nuts] How to use plugin package to do livereload?

2020-04-15 Thread aihui zhu
my program and plugin shares some common package, i'm temporarily copy the plugin's main package to main_$timestamp, so i can avoid same pluginpath and load it many times. but it doesn't works for some problems: if i changes only structure method, because of type equal, the runtime still refers

Re: [go-nuts] x/text: Interest in Unicode text segmentation?

2020-04-15 Thread Ian Lance Taylor
[ +mpvl ] On Wed, Apr 15, 2020 at 2:30 PM Matt Sherman wrote: > > Hi, I am working on a tokenizer based on Unicode text segmentation (UAX 29). > I am wondering if there would be an interest in adding range tables for word > break categories to the x/text or unicode packages. It appears they cou

[go-nuts] x/text: Interest in Unicode text segmentation?

2020-04-15 Thread Matt Sherman
Hi, I am working on a tokenizer based on Unicode text segmentation (UAX 29 ). I am wondering if there would be an interest in adding range tables for word break categories t

Re: [go-nuts] Possible to make go not touch the built file if it builds purely from cache?

2020-04-15 Thread Ian Lance Taylor
On Wed, Apr 15, 2020 at 4:55 AM Glen Huang wrote: > > I have a makefile where upon a new go binary being built, it builds some > other stuff that is not go related. > > The go binary is unconditionally built with a FORCE prerequisite, so the go > build command always runs, but that command alway

[go-nuts] "Go build failed." in Go tour requires explicit Kill

2020-04-15 Thread Marvin Renich
In the Go tour, what is the purpose of requiring the user to explicitly press the "Kill" button when the build fails? This seems completely unnecessary to me. If this is just a natural consequence of the internal implementation, it would, in my opinion, be well worth the effort to make a failed b

[go-nuts] Re: Writing data without synchronization

2020-04-15 Thread Jake Montgomery
On Tuesday, April 14, 2020 at 7:38:44 AM UTC-4, Slawomir Pryczek wrote: > > Hi Guys, was wondering about some things related to multithread code. > > 2. For lazy initialization double-check pattern. I found on several > sources that it is safe, still race detector complains about data races > (

[go-nuts] wording in Go tour, methods/19

2020-04-15 Thread Marvin Renich
In the Go tour at https://tour.golang.org/methods/19 it says The error type is a built-in interface similar to fmt.Stringer: The words closest to "similar to" are "built-in interface", implying that the way error is similar to fmt.Stringer is that it is a built-in interface, which it clearly is

[go-nuts] Re: Possible to make go not touch the built file if it builds purely from cache?

2020-04-15 Thread Brian Candler
Not answering your question directly, but some large projects (e.g. gVisor ) are using bazel, which may solve this for you. Specifically supports multi-language builds. https://bazel.build/ -- You received this message because you are subscribed to th

[go-nuts] Possible to make go not touch the built file if it builds purely from cache?

2020-04-15 Thread Glen Huang
I have a makefile where upon a new go binary being built, it builds some other stuff that is not go related. The go binary is unconditionally built with a FORCE prerequisite, so the go build command always runs, but that command always updates the output binary, which leads to downstream being

[go-nuts] Re: Json Decode Failed

2020-04-15 Thread Ali Hassan
This is not possible because this project is very large On Tuesday, April 14, 2020 at 7:34:49 PM UTC+5, Brian Candler wrote: > > Can you make this as a full runnable example on play.golang.org ? > > What type is a "db.Visitor"? > > When I compile my code it throw error like this 0xc54f40 , 0xc000

[go-nuts] Re: Json Decode Failed

2020-04-15 Thread Ali Hassan
I try and Thank you for help On Tuesday, April 14, 2020 at 6:53:32 PM UTC+5, Ali Hassan wrote: > > dec :=json.NewDecoder(request.Body)//ok > var visitor db.Visitor > err := dec.Decode(&visitor);if err!= nil{ print("error", err) // throw > this error } println("data:", visitor.Id) > > When I c

Re: [go-nuts] Re: Json Decode Failed

2020-04-15 Thread roger peppe
I suspect your client isn't providing the required JSON body when making the request. Try reading the body with `ioutil.ReadAll` before decoding with `json.Unmarshal` so you can see exactly what's being provided. On Wed, 15 Apr 2020 at 09:40, Ali Hassan wrote: > So i will try with printf statem

[go-nuts] Re: Json Decode Failed

2020-04-15 Thread Ali Hassan
So i will try with printf statement, to checkout what's the error , i had ... Error : EOF On Tuesday, April 14, 2020 at 6:53:32 PM UTC+5, Ali Hassan wrote: > > dec :=json.NewDecoder(request.Body)//ok > var visitor db.Visitor > err := dec.Decode(&visitor);if err!= nil{ print("e