[go-nuts] I am confused.

2018-05-20 Thread John
Hello I am just a random person in this small planet of the creation that happens to think that artificial intelligence will take over the world of jobs in the future. With that point of I started to learn Java Script on Khan Academy but didn't quite make that much progress. So I think that

[go-nuts] Re: How can I get the last followed URL use http.Client on 302 Redirections?

2018-05-20 Thread Darren Hoo
Found a hacky solution, https://play.golang.org/p/jLlKR3yjWSw Any better ideas? var client = { CheckRedirect: setFollowURL, } func setFollowURL(req *http.Request, via []*http.Request) error { via[0].URL = req.URL if len(via) >= 10 { return errors.New("stopped after 10 redirects") } return nil

[go-nuts] How can I get the last followed URL use http.Client on 302 Redirections?

2018-05-20 Thread Darren Hoo
if this is how the redirections go: A (original url) => B => C => D I want to know the url of request D the URL of A is never changed, and get the Location header from request is impossible. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group.

[go-nuts] db interface design

2018-05-20 Thread yang sheng
Hi I am trying to practice golang and have some questions regarding to interface design. Say I want to create a simple app to store the book and its author info. I am planning to create interfaces so that I can use different db driver (mysql/mongo/redis...) as long as if they implemented DB

[go-nuts] Re: What powers search on golang.org?

2018-05-20 Thread alex . rou . sg
Tho there is also the offline one used by godoc https://github.com/golang/tools/blob/4e70a1b26a7875f00ca1916637a876b5ffaeec59/godoc/search.go On Monday, 21 May 2018 05:27:53 UTC+8, alex@gmail.com wrote: > > >

[go-nuts] Re: What powers search on golang.org?

2018-05-20 Thread alex . rou . sg
https://github.com/golang/blog/blob/a317451f36b22672c8a079489aa5425b9fa3a9da/content/context/google/google.go Google search On Monday, 21 May 2018 04:08:18 UTC+8, meir fischer wrote: > > golang.org let’s you search all stdlib go source code. > > For example, see

[go-nuts] What powers search on golang.org?

2018-05-20 Thread meirfischer
golang.org let’s you search all stdlib go source code. For example, see https://golang.org/search?q=hello Where is the code that serves these search queries? If the code is not public, does it use a publicly available or at least publicly documented search engine? -- You received this message

Re: [go-nuts] cgo and time.After

2018-05-20 Thread Chris Burkert
Dear Jakob and all, indeed I was blind. This works like a charm: amount := 42 remaining := amount ticker := time.NewTicker(5 * time.Second) defer ticker.Stop() for remaining > 0 { select { case <-ticker.C: fmt.Printf("Progress: %d left from %d\n",