[go-nuts] [ANN] go-resty v1.9.0 released - Simple HTTP and REST client library

2018-08-24 Thread Jeevanandam M.
Production Version : gopkg.in/resty.v1 Edge Version : github.com/go-resty/resty godoc : https://godoc.org/github.com/go-resty/resty Changelog: Enhancement * Added `application/hal+json` content type support PR #171 #172 @kmanley * Made `IsJSONType` and

Re: [go-nuts] Does runtime.RaceDisable not work in non-std library ?

2018-08-24 Thread nealhoo
Thanks a lot. 在 2018年8月25日星期六 UTC+8上午1:32:12,Ian Lance Taylor写道: > > On Fri, Aug 24, 2018 at 12:28 AM, > > wrote: > > > >> go test -v -race -count=5 . > > === RUN TestSyncAPI > > == > > WARNING: DATA RACE > > Read at 0x00c4200ca080 by goroutine 8: > >

[go-nuts] Re: Go 1.11 and 1.10.4 are Released

2018-08-24 Thread Nathan Kerr
I updated my release related resources: - Go Release Timeline - When Should You Upgrade Go? On Friday, August 24, 2018 at 3:24:25 PM UTC-7, Andrew Bonventre wrote: > > Hello

[go-nuts] Go 1.11 and 1.10.4 are Released

2018-08-24 Thread Andrew Bonventre
Hello gophers, We just released Go 1.11 and 1.10.4. You can read the announcement blog post here: https://blog.golang.org/go1.1 1 You can download binary and source distributions from our download page: https://golang.org/dl/ To compile from source using a

[go-nuts] GoAWK: an AWK interpreter written in Go

2018-08-24 Thread Ben Hoyt
I recently wrote an AWK interpreter in Go: https://github.com/benhoyt/goawk It's a pretty simple implementation: hand-rolled lexer, recursive-descent parser, and tree-walk interpreter. It's pretty complete according to the POSIX spec, and it passes the AWK ("one true awk") test suite as well as

Re: [go-nuts] Unsafe Pointer rules

2018-08-24 Thread keith . randall
Just to add, it is ok to have a pointer (unsafe.Pointer or otherwise) to unreadable memory. For instance, you can use syscall.Mmap and syscall.Mprotect to produce such a state. The GC will not dereference any pointer that points outside the Go heap. Public Service Announcement #1: Don't use

Re: [go-nuts] Does runtime.RaceDisable not work in non-std library ?

2018-08-24 Thread Ian Lance Taylor
On Fri, Aug 24, 2018 at 12:28 AM, wrote: > >> go test -v -race -count=5 . > === RUN TestSyncAPI > == > WARNING: DATA RACE > Read at 0x00c4200ca080 by goroutine 8: > _/Users/yanqing11/test/go/sync1.(*Pool).Put() > /Users/yanqing11/test/go/sync1/pool.go:108 +0xe8 >

Re: [go-nuts] Find package versions in a given binary

2018-08-24 Thread Paul Jolly
Hi Tim, There happens to have been a discussion about this recently on Twitter (see https://twitter.com/_myitcv/status/1032836284987977729) Take a look at https://github.com/rsc/goversion The -m flag should give you details of the modules used to build your program. Thanks, Paul On Fri, 24

Re: [go-nuts] Test caching unexpectedly disabled by -exec

2018-08-24 Thread Ian Lance Taylor
On Fri, Aug 24, 2018 at 8:31 AM, Steven Hartland wrote: > > Hi all I've just been banging my head why test our linux test env isn't > caching tests and found that its down to -exec. > > The docs (https://golang.org/cmd/go/#hdr-Build_and_test_caching) refer to > cacheable "test" flags but doesn't

[go-nuts] Find package versions in a given binary

2018-08-24 Thread Tim Waugh
Hi, Does anyone know if there is a tool for working out which package versions were built into a given executable? I see that with Go 1.11 with modules enabled, the filenames embedded in the object have version numbers in them, e.g.: TEXT github.com/Masterminds/semver.(*Version).Equal(SB)

[go-nuts] Re: os.WriteFile not writing files in long running process

2018-08-24 Thread djadala
Hi, did you write files in /tmp on linux ? (and there is daemon that clean old files in /tmp ?) Regards, Djadala -- 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

[go-nuts] Re: os.WriteFile not writing files in long running process

2018-08-24 Thread Manlio Perillo
On Friday, August 24, 2018 at 4:19:17 PM UTC+2, Paweł Szczur wrote: > > Thanks. Both things you mentioned are already fixed. The MakeDir may of > course fail and now I handle it, but in described situation it was not an > issue. > The files were written for most of the day successfully and

Re: [go-nuts] Re: function's argument default value

2018-08-24 Thread Michael Jones
Reinforcing comments above: defaults are not *missing*, they have been *avoided*. One can argue default arguments are either a mistake in API design or neglect in code refactoring. On the mistake side, the argument is that making "cook(n)" mean "make pizza if n is missing or cook n if otherwise"

[go-nuts] Re: Ioctl Syscall with go and c

2018-08-24 Thread jake6502
Probably unrelated to your problem, but IIUC, the syscall package is "deprecated", or "frozen". According to the syscall documentation : > *This package is locked down. Code outside the standard Go repository > should be migrated to use the corresponding

[go-nuts] Test caching unexpectedly disabled by -exec

2018-08-24 Thread Steven Hartland
Hi all I've just been banging my head why test our linux test env isn't caching tests and found that its down to -exec. The docs (https://golang.org/cmd/go/#hdr-Build_and_test_caching) refer to cacheable "test" flags but doesn't mention standard non-test flags. In addition to this

Re: [go-nuts] Re: function's argument default value

2018-08-24 Thread Louki Sumirniy
The distinction you are missing is that Go only considers the *name* of an interface method to be unique, meaning only one parameter definition is allowed per name. What this means is that in Go these have to be separate functions and by definition, differently named. This is why I am

[go-nuts] Re: os.WriteFile not writing files in long running process

2018-08-24 Thread Paweł Szczur
Thanks. Both things you mentioned are already fixed. The MakeDir may of course fail and now I handle it, but in described situation it was not an issue. The files were written for most of the day successfully and suddenly they stopped to appear. The disk was and is not full. There was no error

Re: [go-nuts] Re: function's argument default value

2018-08-24 Thread Robert Johnstone
Hello, This is misleading. With default arguments, there remains only one function definition, which makes it quite different from function overloading where there would be multiple definitions. Default parameters provides syntax sugar at the call site, but does not create additional

Re: [go-nuts] Re: function's argument default value

2018-08-24 Thread Louki Sumirniy
I should just add one more thing, something I discovered when I saw the cete wrapper for the dgraph's badger KV store: https://github.com/1lann/cete If you design your interfaces carefully, and make it so that any function that does not by necessity return some other type, passes through the

Re: [go-nuts] Re: function's argument default value

2018-08-24 Thread Louki Sumirniy
This is in the next section but it's probably even more important: There is one more aspect of naming to be mentioned: method lookup is always by name only, not by signature (type) of the method. In other words, a single type can never have two methods with the same name. Given a method x.M,

Re: [go-nuts] Re: function's argument default value

2018-08-24 Thread Masoud Ghorbani
I found this talks which Rob Pike at syntax section explained why they omitted default function arguments. Thanks all about this discussion. On Friday, August 24, 2018 at 5:21:37 AM UTC+4:30,

[go-nuts] Re: Stream directory content on the fly over HTTP using TAR archive

2018-08-24 Thread Remi Ferrand
That's exactly what I wanted ! I was missing the `io.Writer` interface. Thanks ! Cheers Rémi On Thursday, August 23, 2018 at 7:00:05 PM UTC+2, Tamás Gulácsi wrote: > > > 2018. augusztus 23., csütörtök 18:39:01 UTC+2 időpontban Remi Ferrand a > következőt írta: >> >> Hi everyone, >> >> This is

[go-nuts] Re: unsafe pointer arithmetics - slow code

2018-08-24 Thread 'Florian Uekermann' via golang-nuts
I've opened an issue: https://github.com/golang/go/issues/27180 -- 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. For

[go-nuts] Re: os.WriteFile not writing files in long running process

2018-08-24 Thread Manlio Perillo
On Friday, August 24, 2018 at 11:20:46 AM UTC+2, Paweł Szczur wrote: > > Hi, > > I have a long running hobby program with a code: > > var ( >url = "https://example.com; >lastBody []byte > ) > > > func get(client *http.Client, dir) (changed bool, data []byte, err error) { > >resp,

[go-nuts] os.WriteFile not writing files in long running process

2018-08-24 Thread Tamás Gulácsi
So, the directories are created? Anyway, a resp.Body.Close() is missing. -- 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

[go-nuts] os.WriteFile not writing files in long running process

2018-08-24 Thread Paweł Szczur
Hi, I have a long running hobby program with a code: var ( url = "https://example.com; lastBody []byte ) func get(client *http.Client, dir) (changed bool, data []byte, err error) { resp, err := client.Get(url) if err != nil { return false, nil, err } if

Re: [go-nuts] Does runtime.RaceDisable not work in non-std library ?

2018-08-24 Thread nealhoo
Hi Dave, 1. the report: > go version go version go1.10 darwin/amd64 > go test -v -race -count=5 . === RUN TestSyncAPI == WARNING: DATA RACE Read at 0x00c4200ca080 by goroutine 8: _/Users/yanqing11/test/go/sync1.(*Pool).Put() /Users/yanqing11/test/go/sync1/pool.go:108