[go-nuts] Re: Go 1.11.2 and Go 1.10.5 are released

2018-11-02 Thread Nathan Kerr
I updated my release related resources: - Go Release Timeline - When Should You Upgrade Go? On Friday, November 2, 2018 at 3:06:58 PM UTC-7, Andrew Bonventre wrote: > > Hello

[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] Re: Go 1.10.2 and Go 1.9.5 are released

2018-05-01 Thread Nathan Kerr
I updated my release related resources: - Go Release Timeline - When Should You Upgrade Go? Nathan On Tuesday, May 1, 2018 at 10:04:38 AM UTC-7, Andrew Bonventre wrote: > > Hi

[go-nuts] Re: Go 1.10.1 and Go 1.9.5 are released

2018-03-29 Thread Nathan Kerr
I've updated my release related resources: - Go Release Timeline - When Should You Upgrade Go? Nathan On Thursday, March 29, 2018 at 8:17:34 AM UTC-7, Andrew Bonventre wrote: >

[go-nuts] Re: How to merge labels along with json responses

2018-02-26 Thread Nathan Kerr
The general pattern for this is: 1. Create a data structure that reflects the JSON you want. 2. Fill it with data 3. Marshal or Encode Since you have an example of the JSON you want, putting it through one of the tools from Generating Go structs from JSON

Re: [go-nuts] Re: Go 1.10 is released

2018-02-19 Thread Nathan Kerr
I have also updated my release related resources: - Go Release Timeline - When Should You Upgrade Go? Enjoy! On Monday, February 19, 2018 at 6:17:18 AM UTC-7, Michel Casabianca

[go-nuts] Re: [security] Go 1.8.7, Go 1.9.4, and Go 1.10rc2 are released

2018-02-07 Thread Nathan Kerr
I updated my release related resources with these releases: - When Should You Upgrade Go? - Go Release Timeline Nathan On Wednesday, February 7, 2018 at 1:15:13 PM UTC-7, Andrew

[go-nuts] Re: Decode as JSON and store the JSON as blob in DB

2017-11-21 Thread Nathan Kerr
I think what was meant was to define Service as: type Service struct { ID string `json:"id,omitempty" db:"id"` Name string `json:"name" db:"name"` Contract json.RawMessage `json:"contract" db:"contract"` } This assumes you don't need to access the contents of Service.Contract and they

[go-nuts] [ANN] Pocket Gophers’ Guide to JSON - Early Access Special

2017-11-09 Thread Nathan Kerr
The Pocket Gophers’ Guide to JSON Learn how to confidently handle *any* JSON with the Pocket Gophers’ Guide to JSON. You’ll learn a universal approach to deal with any JSON that leverages encoding/json and other JSON tools in the Go ecosystem along

Re: [go-nuts] Memory leak when calling highly parallel goroutines

2017-10-26 Thread Nathan Kerr
Read Ways to limit concurrent resource use for different methods that can be used to limit concurrency along with example code. On Wednesday, October 25, 2017 at 9:05:44 PM UTC+2, Tamás Gulácsi wrote: > > Just blind shots: > resp.Body.Close(), >

[go-nuts] Re: Go 1.9.2 and Go 1.8.5 are released

2017-10-25 Thread Nathan Kerr
I updated my release related resources: - Go Release Timeline - When Should You Upgrade Go? Nathan On Thursday, October 26, 2017 at 1:52:13 AM UTC+2, Chris Broadfoot wrote: > >

Re: [go-nuts] repeatable builds

2017-10-19 Thread Nathan Kerr
Another option for 2 is https://github.com/cloudflare/hellogopher -- 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: [security] Go 1.8.4 and Go 1.9.1 are released

2017-10-04 Thread Nathan Kerr
I updated my release related resources: - Go Release Timeline - When Should You Upgrade Go? Hope the community finds them useful. Nathan On Wednesday, October 4, 2017 at

[go-nuts] Re: Go 1.9 is released

2017-08-24 Thread Nathan Kerr
Congrats! I updated my Go Release Timeline and When Should You Upgrade Go? pages. On Friday, August 25, 2017 at 12:44:25 AM UTC+2, Chris Broadfoot wrote: > > Hello gophers, > > We just

[go-nuts] Re: Go eval the source

2017-07-25 Thread Nathan Kerr
2017 at 1:41:12 AM UTC-4, Nathan Kerr wrote: >> >> A couple other options: >> >> 1. modify your code, compile, run >> 2. put most of your code in main.go, each specific sort method in a >> separate file (e.g., specific.go) so that go run main.go sp

[go-nuts] Re: Go eval the source

2017-07-21 Thread Nathan Kerr
A couple other options: 1. modify your code, compile, run 2. put most of your code in main.go, each specific sort method in a separate file (e.g., specific.go) so that go run main.go specific.go will use the sorting you need. See https://pocketgophers.com/10-to-instrument/ for an example of

Re: [go-nuts] Will cmd/compile/internal/gc be replaced in the future?

2017-07-19 Thread Nathan Kerr
The ones in the compiler were initially implemented in C. They were converted to Go for go1.5. The others were created to build tools in Go like gofmt. On Wednesday, July 19, 2017 at 5:54:13 PM UTC+2, Eddie Ringle wrote: > > It's not particularly likely that cmd/compile/internal/gc will be >>

[go-nuts] Re: when has multi GOPATH, go can`t detect the vendor folder.

2017-07-18 Thread Nathan Kerr
By "has a vendor folder in it's root dir" do you mean /workspace/specific/project/vendor? If so, go didn't find it because that directory is outside of /workspace/specific/project/src/, and thus not seen as source files in the GOPATH. It works when the project is under /go because the vendor

[go-nuts] Re: [Go2] toward-go2

2017-07-16 Thread Nathan Kerr
The active work for Go2 right now is gathering experience reports . Most of the changes resulting from these reports will land in Go1.x. It is expected that Go2 will only have a few major changes that will not be compatible with Go1. It is also

[go-nuts] Re: Iterate trough interface{} that stores map

2017-07-10 Thread Nathan Kerr
If you know what the map type is, use a type assertion: for k, v := range variable.(map[string]interface{}) { //... } If it could be one of several map types, use a type switch first. If you don't know anything about the map type, I don't know what you think you could do with it because

[go-nuts] Re: display database table in html table like a gridview or dataview.

2017-07-06 Thread Nathan Kerr
For other readers of this thread: This was solved in Display database table in html table like gridview

[go-nuts] Re: Template func ParseFiles, parsing multiple files

2017-07-06 Thread Nathan Kerr
A text.Template contains one or more named templates. ParseFiles adds a new template to the collection with the filename as its name. Template names are used to tell Template.ExecuteTemplate which of the included templates to execute.

Re: [go-nuts] How to access pointer to pointer in cgo

2017-07-05 Thread Nathan Kerr
Did you assign something to the pointer? My guess is that you did not, because the code compiles and then fails at runtime telling the pointer is NULL. On Wednesday, July 5, 2017 at 1:19:47 PM UTC+2, Manohar Reddy wrote: > > > fmt.Println(optional._32.Magic) // did not work for me: HOW TO

[go-nuts] Re: Calling OS X dylib from Go

2017-07-04 Thread Nathan Kerr
The default gc toolchain is fine. Use appropriate LDFLAGS or pkg-config directive in the import "C" comments. Then use the library like you would use any other library. See the libpng example in the cgo documentation . On Tuesday,

[go-nuts] Re: Go type chart

2017-07-02 Thread Nathan Kerr
Are you wanting something like https://github.com/gmarik/go-erd? On Saturday, July 1, 2017 at 8:19:27 PM UTC+2, Tong Sun wrote: > > Hi, > > Any exiting tools out there for Go type chart, to visualize the > relationships of different user defined Go types? Thx. > > > -- You received this

[go-nuts] Re: How do you create and use shared libraries in Go?

2017-06-26 Thread Nathan Kerr
Go packages are usually source code published in web-accessible repositories such as GitHub. The repositories for packages you want to use are checked out/cloned into GOPATH on your local machine using go get

[go-nuts] Re: How to Sync() a file?

2017-06-25 Thread Nathan Kerr
I assume that you mean by io.Copy not working correctly is that you expect the entire contents of File1.txt to be in File2.txt. This does not happen in your code (without reopening f1) because Files maintain an offset inside the file that remembers where the next operation should take place.

[go-nuts] Re: How can I make my own reader

2017-06-25 Thread Nathan Kerr
>From the docs : Read reads up to len(p) bytes into p. This lets the caller of Read manage the allocation and re-use of p. It also means your Read method has to work within the confines of whatever p you are given. If the data being read is larger than p, then the

[go-nuts] Re: godoc shows methods where they're not defined

2017-06-25 Thread Nathan Kerr
Since *conn is embedded in DirectLob, its method sets are promoted to DirectLob's method sets. Since BeginTx is now part of DirectLob's method sets, it acts like any other member of the method sets would; in this case it is an exported method on DirectLob. This is a feature because it allows

Re: [go-nuts] go build for mips

2017-06-22 Thread Nathan Kerr
What system are you building on (OS and architecture)? What version of Go are you using? Is the result of running go build an illegal instruction? What file did you provide information for? What is in hello.go? On Thursday, June 22, 2017 at 6:19:47 PM UTC+2, luc...@kryptus.com wrote: > > I

[go-nuts] Re: XML decoder vs xpath Performance

2017-06-20 Thread Nathan Kerr
Hi, What is "best" depends on your exact situation. This includes the XML you receive, the specific values you need to extract, how much of the XML needs to be extracted, how much of the overall program the XML handling takes, the hardware the program runs on, and the development resources you

[go-nuts] Re: did anyone tried // template exec ?

2017-05-30 Thread Nathan Kerr
I'm not aware of any templating languages that provide concurrent or parallel constructions. If you need parallel execution of those function calls, I would run the calls as part of my Go code and then pass the results to the template. On Tuesday, May 30, 2017 at 10:44:21 AM UTC+2,

Re: [go-nuts] Problem with HINDI NAMES

2017-05-26 Thread Nathan Kerr
The Go team knows this a problem (see the issues listed by Rob Pike). The difficultly in fixing it is that the ecosystem surrounding Go relies on the current definition for identifiers. There is no way to add the characters you need without breaking other tools like syntax highlighters. It is

[go-nuts] Go 1.8.3 is released

2017-05-24 Thread Nathan Kerr
Thanks for the hard work. I updated my Go Release Timeline: https://pocketgophers.com/go-release-timeline/#go1.8.3 -- 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: [security] Go 1.7.6 and Go 1.8.2 are released

2017-05-23 Thread Nathan Kerr
I updated my Go Release Timeline with these updates: https://pocketgophers.com/go-release-timeline/#go1.8.2 On Tuesday, May 23, 2017 at 9:28:01 PM UTC+2, Chris Broadfoot wrote: > > A security-related issue was recently reported in Go's crypto/elliptic > package. > To address this issue, we have

[go-nuts] Re: Feedback welcome: "Shorten your URL"

2017-05-03 Thread Nathan Kerr
There are also responses here: Feedback Welcome: ‘Shorten your URL’ On Tuesday, May 2, 2017 at 9:32:45 AM UTC+2, Lutz Horn wrote: > > Hi Go Nuts, > > to practice my Go skills, I've implemented a simple

[go-nuts] Fully-qualified import paths and Pull Requests

2017-05-03 Thread Nathan Kerr
http://blog.sgmansfield.com/2016/06/working-with-forks-in-go/ gives some good pointers on how to do this. -- 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] openid connect

2017-05-03 Thread Nathan Kerr
Try using https://github.com/markbates/goth -- 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 more options, visit

[go-nuts] Re: Go 1.8.1 is released

2017-04-07 Thread Nathan Kerr
Thanks for all the hard work! I have updated my go release timeline visualization. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

[go-nuts] Re: Error checking and defer

2017-03-16 Thread Nathan Kerr
I prefer to accept that multiple errors can occur. https://pocketgophers.com/handling-errors-in-defer/ -- 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

Re: [go-nuts] Re: Trying to understand := and named return values

2017-02-23 Thread Nathan Kerr
They also seem to be the only way to handle errors in defer without panic or log.Fatal. On Wednesday, February 22, 2017 at 6:24:41 AM UTC+1, Paul Borman wrote: > > Named return values are perfectly fine, and I agree, probably should not >

[go-nuts] Re: NewTicker function example

2017-02-23 Thread Nathan Kerr
NewTicker function example The task of running functions on a periodic basis can be split into two parts: timing and execution. A ticker solves the timing problem by providing a channel that get new input every period. Keeping the timing separate mitigates the impact of execution on the

[go-nuts] Re: unexpected end of JSON input while unmarshal to struct

2017-02-23 Thread Nathan Kerr
; name. This is one of the hazards of implicit interfaces. On Thursday, February 23, 2017 at 2:48:22 AM UTC+1, Diogo Ribeiro wrote: > > Thanks Nathan, it worked. > I didn't know that *LimitOrder.UnmarshalJSON would call json.Unmarshal. > > Em terça-feira, 21 de fevereiro de 2017 05:24:

[go-nuts] Re: Import path search order?

2017-02-21 Thread Nathan Kerr
andard library is distributed as source. On Tuesday, February 21, 2017 at 5:51:10 PM UTC+1, so.q...@gmail.com wrote: > > Thanks! > > what do you mean by "from left to right"? > And by GOROOT, you mean it looks at the go source? > > > > On Tuesday, February 21,

Re: [go-nuts] Initializing nested struct, by dynamically forming struct member path

2017-02-21 Thread Nathan Kerr
Could you give an example of the json you are starting from? Also, what database are you using? On Sunday, February 19, 2017 at 8:27:32 AM UTC+1, Bharath B wrote: > > Hi, > > I am trying to read those values and store in DB. > > Regards, > Bharath B > -- You received this message because you

[go-nuts] Re: Import path search order?

2017-02-21 Thread Nathan Kerr
Relative package don't need to be searched for, they are explicit (indicated with ./ or ../) Then it seems to be: 1. vendor tree, if it exists 2. GOROOT 3. GOPATH, from left to right Trying to build a package with an import that cannot be found will display an error listing all the locations

[go-nuts] Re: unexpected end of JSON input while unmarshal to struct

2017-02-21 Thread Nathan Kerr
I figured it out. First off, the posted playground had a different json string and did not use your UnmarshalJSON function. These made translating between the non-working setup described in your post and the working playground annoying. In the future, share the non-working setup. At the point

[go-nuts] Re: Registering a Go app as a protocol handler under Mac OS X

2017-02-20 Thread Nathan Kerr
I managed to get this working. https://gist.github.com/nathankerr/38d8b0d45590741b57f5f79be336f07c I don't know what sort of app you are making, so I made a simple gui that displays the url received, with some filler text before any are. I think the non-ui parts should transfer to whatever you

[go-nuts] Re: How to know the listener

2017-01-10 Thread Nathan Kerr
Hi, You can use RemoteAddr from *http.Request to tell the difference. When the request comes through the unix socket, RemoteAddr is "" (i.e., blank). The source for my test server is at https://play.golang.org/p/m3h_L_ACks I used curl 127.0.0.1:3001 to test the tcp socket and curl-unix-socket

[go-nuts] Re: How to setup go-swagger for an existing project to generate API docs

2016-10-20 Thread Nathan Kerr
I just tried this out and discovered that an operationId is required for swagger:route: // swagger:route GET /profile getProfile tags go between the path and the operationId: // swagger:route GET /profile tag1 tag2 getProfile Hope this helps. On Monday, October 17, 2016 at 7:01:52 AM

[go-nuts] Re: how to apply netutil.LimitListener() to ListenAndServeTLS()'s listener? how to fetch ListenAndServeTLS()'s listener?

2016-08-04 Thread Nathan Kerr
net.http.ListenAndServeTLS and stuff surrounding it. > > > On Wednesday, August 3, 2016 at 9:19:40 AM UTC-4, Nathan Kerr wrote: >> >> Your research revealed the essential lines from ListenAndServeTLS that >> basically say: >> >> 1. crea

[go-nuts] Re: how to apply netutil.LimitListener() to ListenAndServeTLS()'s listener? how to fetch ListenAndServeTLS()'s listener?

2016-08-03 Thread Nathan Kerr
Your research revealed the essential lines from ListenAndServeTLS that basically say: 1. create a tls listener 2. have the server serve using that listener The LimitListener example follows this same pattern, just with net.Listener instead of a tls.Listener. A careful reading reveals that

[go-nuts] Re: howto kill pipe process using gopkg.in/pipe.v2

2016-07-30 Thread Nathan Kerr
State.Kill works, but it is not immediately obvious how to use it or how to discover that it can be used. I wrote down my process to discover this, starting from your example and ending with a working prototype on my site: https://pocketgophers.com/expanding-convenience-functions/. Hope this