[go-nuts] Re: Difficulties Using golang.org/x/net/html

2018-01-25 Thread dc0d
Solved: problem is component is not a standard html tag. That's why the parser does not respect the self closing version. So if instead of a properly closed one like is used, it will work properly. (Help from gophers slack) On Thursday, January 25, 2018 at 12:48:26 PM UTC+3:30, dc0d wrote: >

[go-nuts] Re: Go 1.10 release candidate 1 is released

2018-01-25 Thread -- --
Awesome! 在 2018年1月26日星期五 UTC+8上午5:26:42,Andrew Bonventre写道: > > Hello gophers, > > We have just released go1.10rc1, a release candidate of Go 1.10. > It is cut from release-branch.go1.10 at the revision tagged go1.10rc1. > > Thank you to everyone who has helped to test Go 1.10 so far. > We

[go-nuts] Re: Go 1.10 release candidate 1 is released

2018-01-25 Thread chengang31
There is an extra file bin\go.exe~ in windows x64 package, I believe it shouldn't be there. On Friday, January 26, 2018 at 5:26:42 AM UTC+8, Andrew Bonventre wrote: > > Hello gophers, > > We have just released go1.10rc1, a release candidate of Go 1.10. > It is cut from release-branch.go1.10 at

[go-nuts] Re: AWS CodeBuild with govendor

2018-01-25 Thread robfromcornell
I think you will be good if you remove the previous version of go first. Add these lines to the first commands under INSTALL - echo "remove previous version of go" - rm -rf /usr/local/go On Wednesday, May 10, 2017 at 8:26:28 AM UTC-4, Kareem Hepburn wrote: > > Anyone here have a buildspec

[go-nuts] Re: Is it possible to determine total number of bytes read/written for an HTTP request? (including headers)

2018-01-25 Thread aroman
Interesting. I wouldn't expect kernel functions to give me per-request statistics, however, I'd expect per-process (or if I'm lucky per-thread) statistics. Is that what you were imagining? On Thursday, January 25, 2018 at 5:19:02 PM UTC-7, simon place wrote: > > i think there should be

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

2018-01-25 Thread Jeevanandam M.
Thank you Matt for your inputs and suggestions. I will look into it. Cheers, Jeeva On Thursday, January 25, 2018 at 3:36:44 PM UTC-8, matthe...@gmail.com wrote: > > Hi Jeeva, here’s a code review. > > In client.go *Client R() the creation of the *Request unnecessarily sets > zero values for

Re: [go-nuts] Re: First time building a rest-api-based web app: general security-related questions

2018-01-25 Thread matthewjuran
Here's where I've gotten with custom user authentication, this may be a starting point for some people: https://gist.github.com/pciet/8529531fffbe8d9523d883c901d311da Matt On Thursday, January 25, 2018 at 4:40:29 PM UTC-6, Jeff Goldberg wrote: > > On Jan 25, 2018, at 2:58 PM, Pat Farrell

[go-nuts] Re: Web Framework for Beginners

2018-01-25 Thread matthewjuran
> > Specific question: how do you handle the user hitting the "back" button on > their browser? Its very common and a lot of simple approaches don't handle > it well. This was a problem for me. I force the page to reload instead of using the cache: //

[go-nuts] if you use sql.NullXYZ, what else do you find yourself doing to make coding easier (or make your code more readable, etc...)

2018-01-25 Thread evan
i'm actually using "github.com/markbates/pop/nulls" because i need correct json marshalling and unmarshalling. but i was wondering: aside from above json requirements, and writing helper methods such as those discussed in

[go-nuts] Re: Is it possible to determine total number of bytes read/written for an HTTP request? (including headers)

2018-01-25 Thread 'simon place' via golang-nuts
i think there should be several tools to do this tracking by using kernel functions, probably X-platform. maybe in the design of the go package this was assumed to be the way its done. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] [ANN] gluo v0.0.2 released - Write your Go net/http server once, deploy it everywhere

2018-01-25 Thread Dario Castañé
I'm pleased to announce the launch of Gluo: a handy wrapper for net/http applications that allows to deploy the exact same binary to AWS Lambda and (bare-metal/virtual) servers. https://github.com/imdario/gluo If you want to use your current net/http code with little modification, Gluo is your

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

2018-01-25 Thread matthewjuran
Hi Jeeva, here’s a code review. In client.go *Client R() the creation of the *Request unnecessarily sets zero values for fields. They could just be omitted instead. Same in default.go at func createClient. The Client type could have *log.Logger and http.Header embedded in the struct instead

Re: [go-nuts] Re: First time building a rest-api-based web app: general security-related questions

2018-01-25 Thread Jeffrey Goldberg
On Jan 25, 2018, at 2:58 PM, Pat Farrell wrote: > On Thursday, January 25, 2018 at 8:33:40 AM UTC-5, matthe...@gmail.com wrote: > > (2) would using a session cookie + some authorization middleware (such as > > casbin) make sense for our situation? what are its pro's and

[go-nuts] Go 1.10 release candidate 1 is released

2018-01-25 Thread Andrew Bonventre
Hello gophers, We have just released go1.10rc1, a release candidate of Go 1.10. It is cut from release-branch.go1.10 at the revision tagged go1.10rc1. Thank you to everyone who has helped to test Go 1.10 so far. We still need more people to test, especially on production workloads. Your help is

[go-nuts] Re: Web Framework for Beginners

2018-01-25 Thread Florin Pățan
While you are right, you get a lot from the builtin stuff, a potential user coming from another language does not want to go via the chores of constructing their own router. Or other helpers. Or if they are used to ORMs, getting back to good old SQL will be a major problem. And so on and so

[go-nuts] Re: Web Framework for Beginners

2018-01-25 Thread Pat Farrell
On Thursday, January 25, 2018 at 8:36:29 AM UTC-5, matthe...@gmail.com wrote: > > Here’s a third vote for the standard library. > https://golang.org/pkg/net/http/ + https://golang.org/pkg/html/template/ > are already effectively a web framework. > OK, I know this is a frequent answer, just use

[go-nuts] Re: First time building a rest-api-based web app: general security-related questions

2018-01-25 Thread Pat Farrell
On Thursday, January 25, 2018 at 8:33:40 AM UTC-5, matthe...@gmail.com wrote: > > > (2) would using a session cookie + some authorization middleware (such > as casbin) make sense for our situation? what are its pro's and con's? > > This is what I'm familiar with. The main con is having to check

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

2018-01-25 Thread Jeevanandam M.
Stable Version : gopkg.in/resty.v1 Edge Version : github.com/go-resty/resty godoc : https://godoc.org/github.com/go-resty/resty Changelog: Features: * Added Request URL Path Params #103 @jeevatkm Enhancements: * Auto detects file content type in mutlipart/form-data mode #109, PR

Re: [go-nuts] syscall.SetNonblock stopped working in Go 1.9.3

2018-01-25 Thread Dave Keck
Thanks all. I opened this issue: https://github.com/golang/go/issues/23556 (The reason I'm using SetNonblock is that before Go 1.9, it wasn't safe to call file.Close() if another goroutine was reading/writing to the pipe. But now that it's safe with Go 1.9, I can re-organize my code and

Re: [go-nuts] syscall.SetNonblock stopped working in Go 1.9.3

2018-01-25 Thread Peter Mogensen
On 2018-01-25 16:18, Ian Lance Taylor wrote: > On Thu, Jan 25, 2018 at 7:04 AM, Max wrote: >> Also, os.File.Fd() having side effects seems very unexpected and surprising >> at least to me. .File() on a network conn have had that effect. > I found it very

Re: [go-nuts] Re: Graven: Build tool for Go projects.

2018-01-25 Thread Clinton Begin
Thanks Matt, I'm familiar with the pattern. It might be a good subject for another thread, specifically comparing this approach to interfaces. It's an interesting design discussion. Cheers, Clinton On Thu, Jan 25, 2018 at 6:19 AM, wrote: > Hi Clinton, > > Here's an

[go-nuts] Re: URL handling

2018-01-25 Thread Michael Jones
Never mind. After studying the code and sections 2.2 and 3.3 of RFC 3986 I have come to some peace about this. https://tools.ietf.org/html/rfc3986#section-3.3 src/net/url/url.go On Wed, Jan 24, 2018 at 11:07 PM, Michael Jones wrote: > Why doesn’t url.PathEscape convert

Re: [go-nuts] syscall.SetNonblock stopped working in Go 1.9.3

2018-01-25 Thread Ian Lance Taylor
On Thu, Jan 25, 2018 at 7:04 AM, Max wrote: > > Thanks for the explanation and the solution :) > > Where is this behaviour documented? > > The current documentation https://golang.org/pkg/os does not indicate > blocking vs non blocking behaviour of *os.File and of

Re: [go-nuts] syscall.SetNonblock stopped working in Go 1.9.3

2018-01-25 Thread Max
Thanks for the explanation and the solution :) Where is this behaviour documented? The current documentation https://golang.org/pkg/os does not indicate blocking vs non blocking behaviour of *os.File and of functions that return *os.File, as for example os.Pipe() Also, os.File.Fd() having side

[go-nuts] Re: Gorilla Sessions Example Question

2018-01-25 Thread aikiav8r
in looking at the sample code, I saw that the logout handler was updating the cookie, so I was assuming that was enough for the next call to secret to be fail and respond as forbidden. Yes, I think I am missing a little of the details for the cookies. As it stands, I hit the endpoints from a

Re: [go-nuts] syscall.SetNonblock stopped working in Go 1.9.3

2018-01-25 Thread Ian Lance Taylor
On Wed, Jan 24, 2018 at 8:06 PM, Dave Keck wrote: > > Hey all, this program exits (as expected) when run with macOS 10.12.6 + Go > 1.8.6, but it deadlocks when run with Go 1.9.3: > > https://play.golang.org/p/Dw_ND9gkgPm > > The same behavior is observed when using

[go-nuts] Re: Web Framework for Beginners

2018-01-25 Thread matthewjuran
Here’s a third vote for the standard library. https://golang.org/pkg/net/http/ + https://golang.org/pkg/html/template/ are already effectively a web framework. Matt On Thursday, January 25, 2018 at 3:15:25 AM UTC-6, Florin Pățan wrote: > > Big plus one for Buffalo. Out of the frameworks I've

[go-nuts] Re: Gorilla Sessions Example Question

2018-01-25 Thread matthewjuran
Normally a web browser would lose the initial cookie value. I think you may be misunderstanding the use of the gorilla/sessions library (I did even after inspecting the documentation and source code for awhile). The point is to store arbitrary values in a store, not provide any form of

[go-nuts] Stripe API versioning scheme in Go

2018-01-25 Thread Tiemo Kieft
This question was originally posted on Stack Overflow, but put on hold due to it being too broad. This question is inspired by a blog post by Stripe titled APIs as infrastructure: future-proofing Stripe with versioning My background is in Python, but

[go-nuts] Re: Graven: Build tool for Go projects.

2018-01-25 Thread matthewjuran
Hi Clinton, Here's an example for the struct of function approach: https://play.golang.org/p/F_f0hLNsmSW These are not key issues, I'm just sharing the path I've been on. Thanks for sharing Graven here. I'll read those references. Matt On Wednesday, January 24, 2018 at 3:57:27 PM UTC-6,

Re: [go-nuts] syscall.SetNonblock stopped working in Go 1.9.3

2018-01-25 Thread Max
I tried on Linux/amd64 (debian testing, kernel 4.14.0-2-amd64) and it's broken too: * go 1.9.3 + syscall.SetNonblock : hangs in syscall.Read() * go 1.9.3 + unix.SetNonblock: hangs in syscall.Read() * go 1.9.2 + syscall.SetNonblock : hangs in syscall.Read() * go 1.9.2 + unix.SetNonblock:

Re: [go-nuts] syscall.SetNonblock stopped working in Go 1.9.3

2018-01-25 Thread Steven Hartland
I checked this on FreeBSD and it still works, so seems like it could be a macOS specific issue. You should raise a bug here: https://github.com/golang/go/issues It would be good to try and identify the go version which it first broke in too, as that will be helpful in identifying the change

[go-nuts] Difficulties Using golang.org/x/net/html

2018-01-25 Thread dc0d
How to parse custom (nested) elements using golang.org/x/net/html? It parses the custom element correctly but if there are nested custom elements, the next siblings are parsed as children of the parent custom element. https://play.golang.org/p/Iu4RP6qp60p the closing tag for another () should

[go-nuts] net/http.Pusher says HTTP/2 spec disallows recursive pushes

2018-01-25 Thread Gabriel Sullice
Perhaps this is a better question for golang-dev, but I'll give it a shot here. net/http.Pusher says HTTP/2 spec disallows recursive pushes: The HTTP/2 spec disallows recursive pushes and cross-authority pushes.Push may or may not detect these invalid

[go-nuts] Re: Web Framework for Beginners

2018-01-25 Thread Florin Pățan
Big plus one for Buffalo. Out of the frameworks I've seen in Go so far, Buffalo tries its best to stay close to the spirit of Go while delivering all the power to the user in an idiomatic manner. Do give it a try. -- You received this message because you are subscribed to the Google Groups

[go-nuts] Re: First time building a rest-api-based web app: general security-related questions

2018-01-25 Thread ofbizfanster
thanks for the reply. we'll use https in production for sure because the data going back and forth are valuable business data. the users from the 3 locations are all employees of the organization, but because we're opening up the api to the internet (to accommodate those remote employees), we