[go-nuts] Re: https://http2.golang.org/ shows http/2 disabled on chrome but it's not!

2016-12-29 Thread Uli Kunitz
It must be something in your setup. It works for me here with Chrome 55.0.2883.87 m (64-bit) on Windows 10 Home 1604 Build 14393.576. On Thursday, December 29, 2016 at 11:25:40 PM UTC+1, Mahdi Ziraki wrote: > > so far: > firefox & chrome Ubuntu 16.0.4 works fine. > firefox & chrome Android 7.1.1

Re: [go-nuts] Re: How has your company adopted Go ?

2016-12-29 Thread Haddock
Thanks Henrik and Eric. Replacing some service to start with bridging Java and Go through http or nats is a good idea. I'll pick that one up ;-). Am Donnerstag, 29. Dezember 2016 23:41:35 UTC+1 schrieb Eric Johnson: > > Stand-alone services are definitely the way to go. Pick a small service > th

[go-nuts] [ANN] Luar v2

2016-12-29 Thread 'Peter Neidhardt' via golang-nuts
I'd like to announce Luar v2, the Lua reflection bindings for Go (based on Arzilli's Golua). Luar is a convenience bridge between Lua and Go, with awesomeness like: - Modify Go data (maps, structures, you name it) from Lua using regular Lua syntax (e.g. `m[3] = 17` and `m.field = 'foobar'`). - C

[go-nuts] Re: Do you guys use ORMs when working with SQL?

2016-12-29 Thread a . modzelewski
I far prefer solutions like Squirrel (https://github.com/Masterminds/squirrel) to ORMs for most problems — I still write queries, but use a more convenient syntax. It also means I'm less likely to somehow accidentally introduce an injection vulnerability. Usually that's enough abstraction to ge

Re: [go-nuts] Re: How to use ~/ in terminal with go program?

2016-12-29 Thread Aurélien DESBRIÈRES
What do you mean by more safe? On Fri, Dec 30, 2016, 4:04 AM Matt Harden wrote: > Based on Jan's reply, https://play.golang.org/p/-7NUaJwoOf is a little > more safe. > > On Thu, Dec 29, 2016 at 8:13 AM Aurélien Desbrières < > aurelien.desbrie...@gmail.com> wrote: > > The original code is https:/

Re: [go-nuts] custom json unmarshaling between object or arrays

2016-12-29 Thread Matt Harden
https://play.golang.org/p/gWQuthS0D6 On Wed, Dec 28, 2016 at 11:55 PM Sathish VJ wrote: > aah, got it. the case []interface{}: is what I'd not gotten right. > Thanks for the detailed examples. > > > On Thursday, 29 December 2016 12:57:54 UTC+5:30, Konstantin Khomoutov > wrote: > > On Wed, 28 De

Re: [go-nuts] Re: How to use ~/ in terminal with go program?

2016-12-29 Thread Matt Harden
Based on Jan's reply, https://play.golang.org/p/-7NUaJwoOf is a little more safe. On Thu, Dec 29, 2016 at 8:13 AM Aurélien Desbrières < aurelien.desbrie...@gmail.com> wrote: > The original code is https://play.golang.org/p/CTbhTC50eE > It is write to works as: > > go run gocat.go > > Here is how

[go-nuts] Re: Do you guys use ORMs when working with SQL?

2016-12-29 Thread Jakub Labath
Hi, When I gave some thought to the whole ORM, I concluded it was not the SQL that bothered me it was these items 1. Adding a new column to table means having to revisit every query/insert/update that could be affected 2. Serializing and de-serializing as things get saved/read from DB (dealing

[go-nuts] Re: https://http2.golang.org/ shows http/2 disabled on chrome but it's not!

2016-12-29 Thread John C.
I show http/2 working at https://http2.golang.org/ on Win10 x64 with Chrome 56.0.2924.28 beta (64-bit). Home internet connection, ordinary neighborhood internet provider. On Thursday, December 29, 2016 at 4:39:02 PM UTC-5, Dave Cheney wrote: > > Right, so it's a bug with chrome on windows.

[go-nuts] Re: https://http2.golang.org/ shows http/2 disabled on chrome but it's not!

2016-12-29 Thread Mahdi Ziraki
nothing found! On Friday, December 30, 2016 at 2:59:33 AM UTC+3:30, r...@skyportsystems.com wrote: > > is it possible your windows host is behind either an explicit proxy or a > transparent proxy (like bluecoat)? > > for the explicit case, > > reg query > "HKEY_CURRENT_USER\Software\Micro

[go-nuts] Re: https://http2.golang.org/ shows http/2 disabled on chrome but it's not!

2016-12-29 Thread rsr via golang-nuts
is it possible your windows host is behind either an explicit proxy or a transparent proxy (like bluecoat)? for the explicit case, reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" look for "proxyserver" or "AutoConfigURL" -- You received this

[go-nuts] Re: https://http2.golang.org/ shows http/2 disabled on chrome but it's not!

2016-12-29 Thread Mahdi Ziraki
can you suggest any solution about how can I fix this? On Friday, December 30, 2016 at 1:46:30 AM UTC+3:30, Dave Cheney wrote: > > Can any windows users reproduce this issue? > > On Friday, 30 December 2016 08:48:36 UTC+11, Mahdi Ziraki wrote: >> >> it's response with http/1.1 not just in chrome f

Re: [go-nuts] Re: How has your company adopted Go ?

2016-12-29 Thread 'Eric Johnson' via golang-nuts
Stand-alone services are definitely the way to go. Pick a small service that either is yet to be written, or is performing badly in its current Java implementation. Eric On Dec 29, 2016, at 12:35 AM, Haddock wrote: This thread is very interesting to me as I'm working exclusively with Java and a

[go-nuts] Re: https://http2.golang.org/ shows http/2 disabled on chrome but it's not!

2016-12-29 Thread Mahdi Ziraki
so far: firefox & chrome Ubuntu 16.0.4 works fine. firefox & chrome Android 7.1.1 works fine. edge, firefox & chrome Windows 10 returns http/1.1 (but it works fine with "github.com/davecheney/httpstat") On Friday, December 30, 2016 at 12:11:21 AM UTC+3:30, Mahdi Ziraki wrote: > > > -- You recei

[go-nuts] Re: https://http2.golang.org/ shows http/2 disabled on chrome but it's not!

2016-12-29 Thread Dave Cheney
Can any windows users reproduce this issue? On Friday, 30 December 2016 08:48:36 UTC+11, Mahdi Ziraki wrote: > > it's response with http/1.1 not just in chrome for windows, it has same > issue with edge & firefox too! and it's behaving like this just for golang > code, it's ok for other sites (g

[go-nuts] Re: https://http2.golang.org/ shows http/2 disabled on chrome but it's not!

2016-12-29 Thread Mahdi Ziraki
it's response with http/1.1 not just in chrome for windows, it has same issue with edge & firefox too! and it's behaving like this just for golang code, it's ok for other sites (google, youtube & etc.) On Friday, December 30, 2016 at 1:09:02 AM UTC+3:30, Dave Cheney wrote: > > Right, so it's a b

[go-nuts] Re: https://http2.golang.org/ shows http/2 disabled on chrome but it's not!

2016-12-29 Thread Mahdi Ziraki
I tested httpstat and got http/2, so how http2 in all windows browsers (edge, firefox, chrome) have same bug?! On Friday, December 30, 2016 at 1:01:38 AM UTC+3:30, Dave Cheney wrote: > > You could try > > GitHub.com/davecheney/httpstat > > Which is a simple curl replacement written in Go which

[go-nuts] Re: https://http2.golang.org/ shows http/2 disabled on chrome but it's not!

2016-12-29 Thread Dave Cheney
Right, so it's a bug with chrome on windows. -- 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 ht

[go-nuts] Re: concurrent sqlite database access... how to handle?

2016-12-29 Thread Eric Brown
Thank you, Dave. That was just code I copied & pasted, and removed pieces while in the textarea submit box on this page. I didn't know about this way of the map lookup... thanks. I'm still learning Go. It's actually my first language, and still need to look into coding standards and syntax,

[go-nuts] Re: concurrent sqlite database access... how to handle?

2016-12-29 Thread Eric Brown
Appreciate the sample, very much. Go is my first language, and still learning. It's just a hobby at the moment (which I'm sure you can tell by my amateur code). Still need to learn about coding standards, etc. On Thursday, December 29, 2016 at 2:13:54 PM UTC-6, Val wrote: > > Hi Eric > here i

[go-nuts] Re: https://http2.golang.org/ shows http/2 disabled on chrome but it's not!

2016-12-29 Thread Mahdi Ziraki
I tested this on 2 PCs and got same issue. then on android it was ok. at last on ubuntu it was ok too. On Friday, December 30, 2016 at 1:00:14 AM UTC+3:30, Dave Cheney wrote: > > Either this is a bug in chrome on windows, or it's something related to > your network setup. > > I don't think the b

[go-nuts] Re: https://http2.golang.org/ shows http/2 disabled on chrome but it's not!

2016-12-29 Thread Dave Cheney
You could try GitHub.com/davecheney/httpstat Which is a simple curl replacement written in Go which supports http/2 natively. If that is able to negotiate a http/2 request then the problem is likely on your windows machine. -- You received this message because you are subscribed to the G

[go-nuts] Re: https://http2.golang.org/ shows http/2 disabled on chrome but it's not!

2016-12-29 Thread Mahdi Ziraki
I used this sample code: package main import ( "fmt" "log" "net/http" "strings" ) func main() { http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { w.Write([]byte(formatRequest(req))) }) log.Fatalln(http.ListenAndServeTLS(":443", "certificate.crt", "private.key", nil)) } func

[go-nuts] Re: https://http2.golang.org/ shows http/2 disabled on chrome but it's not!

2016-12-29 Thread Dave Cheney
Either this is a bug in chrome on windows, or it's something related to your network setup. I don't think the bug is in Go's http/2 implementation. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiv

[go-nuts] Re: https://http2.golang.org/ shows http/2 disabled on chrome but it's not!

2016-12-29 Thread Mahdi Ziraki
yes, but I use same VPN that I use in my phone! but it's behaving like this only on Windows, and it's ok on Linux Ubuntu & Android! On Friday, December 30, 2016 at 12:50:20 AM UTC+3:30, Dave Cheney wrote: > > Do you have any av software on your computer that may be enforcing a proxy? > > Does you

[go-nuts] Re: concurrent sqlite database access... how to handle?

2016-12-29 Thread Dave Cheney
Also, try using the two return value version of a map lookup to avoid having to recover from a nil pointer error when unlocking a non existent lock value. https://tour.golang.org/moretypes/22 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Re: concurrent sqlite database access... how to handle?

2016-12-29 Thread Dave Cheney
This code does not compile, your unlock function has an unused variable. -- 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.

[go-nuts] Re: https://http2.golang.org/ shows http/2 disabled on chrome but it's not!

2016-12-29 Thread Dave Cheney
Do you have any av software on your computer that may be enforcing a proxy? Does your environment enforce a proxy? -- 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 t

[go-nuts] Re: https://http2.golang.org/ shows http/2 disabled on chrome but it's not!

2016-12-29 Thread Mahdi Ziraki
it's fine in chrome for android but not in chrome for windows (or any other browsers for windows)! -- 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+un

[go-nuts] https://http2.golang.org/ shows http/2 disabled on chrome but it's not!

2016-12-29 Thread Mahdi Ziraki
-- 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 https://groups.google.com/d/optout.

[go-nuts] Re: concurrent sqlite database access... how to handle?

2016-12-29 Thread Eric Brown
Sorry, left some comments and stuff in there. Tried to condense it as much as possible. On Thursday, December 29, 2016 at 2:16:46 PM UTC-6, Eric Brown wrote: > > package configurationLockExample > > import ( > "sync" > ) > > type _lockReference struct { > fileIdentifier map[string]*sync.

[go-nuts] Re: concurrent sqlite database access... how to handle?

2016-12-29 Thread Eric Brown
package configurationLockExample import ( "sync" ) type _lockReference struct { fileIdentifier map[string]*sync.Mutex var ( _configurationLock _lockReference _lockReferenceLock sync.RWMutex ) func init() { _configurationLock.fileIdentifier = make(map[string]*sync.Mutex) } f

[go-nuts] Re: concurrent sqlite database access... how to handle?

2016-12-29 Thread Val
Hi Eric here is some sample code, with - a "correct" implementation : it passes the race detector, and it behaves as expected : no overlapping of queries on a specific file. - an "incorrect" impl that doesn't guard the

[go-nuts] Re: NPN disabled in chrome

2016-12-29 Thread Mahdi Ziraki
I found out NPN is not the issue, because golang supports ALPN but I don't know what's the reason to this issue. I ran a test on a PC & Android and got this: https://github.com/golang/go/issues/18462#issuecomment-269681906 On Thursday, December 29, 2016 at 9:49:16 PM UTC+3:30, Mahdi Ziraki wrote

[go-nuts] Re: concurrent sqlite database access... how to handle?

2016-12-29 Thread Dave Cheney
Could you show some code, perhaps we can spot the point you're going wrong. On Friday, 30 December 2016 05:43:19 UTC+11, Eric Brown wrote: > > Thanks Val, I actually tried that approach... and failed. Perhaps I > incorporated it wrong. I put the handling of locking/unlocking of the > map[strin

[go-nuts] Re: concurrent sqlite database access... how to handle?

2016-12-29 Thread Eric Brown
Thanks Val, I actually tried that approach... and failed. Perhaps I incorporated it wrong. I put the handling of locking/unlocking of the map[string]*sync.Mutex in it's own function, which was encapsulated in the global mutex like you suggested. Only problem was, was that the database functi

[go-nuts] NPN disabled in chrome

2016-12-29 Thread m . zirakit
today I noticed my project stopped to serve http/2 and serves http/1.1 after lots of search I found this: https://ma.ttias.be/day-google-chrome-disables-http2-nearly-everyone-may-31st-2016/ and I noticed http2.golang.org stopped working correctly like my project in chrome v55 for Windows. I wa

Re: [go-nuts] Re: How has your company adopted Go ?

2016-12-29 Thread Henrik Johansson
For us they interact exclusively through either plain http based services or via Nats, no other interactions take place. It works as expected without any particular issues. I would suggest that you start with a similar approach and create a self contained little service to show that Go not only wor

Re: [go-nuts] Re: How to use ~/ in terminal with go program?

2016-12-29 Thread Aurélien Desbrières
The original code is https://play.golang.org/p/CTbhTC50eE It is write to works as: go run gocat.go Here is how it works at this time. $ go run gocat.go Which file would you like to read?: ~/bob 2016/12/29 17:10:19 my program broken exit status 1 $ go run gocat3.go Which file would you like to r

Re: [go-nuts] Re: How to use ~/ in terminal with go program?

2016-12-29 Thread Jan Mercl
On Thu, Dec 29, 2016 at 2:41 PM Aurélien Desbrières < aurelien.desbrie...@gmail.com> wrote: Something like https://play.golang.org/p/v0qPerJi4y ? -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop rec

Re: [go-nuts] Re: How to use ~/ in terminal with go program?

2016-12-29 Thread Aurélien Desbrières
Oh so that is not an official stuff from go but an outside library ~_~ Is there any ways more "official" to do that? On Thursday, December 29, 2016 at 7:17:02 AM UTC+1, Aurélien Desbrières wrote: > > That sounds good. I will try it and tell you back. Thanks > > On Thu, Dec 29, 2016, 5:02 AM Cale

Re: [go-nuts] Behaviour manifested by select statement

2016-12-29 Thread Abhishek Singh
Thanks Caleb, this is looks more idiomatic Go. > On 29-Dec-2016, at 17:14, Caleb Doxsey wrote: > > Use time.After: > > package main > > import ( > "log" > "math/rand" > "time" > ) > > func randomSleep(min, max int64) <-chan time.Time { > rand.Seed(time.

[go-nuts] Re: Behaviour manifested by select statement

2016-12-29 Thread Caleb Doxsey
Use time.After: package main import ( "log" "math/rand" "time" ) func randomSleep(min, max int64) <-chan time.Time { rand.Seed(time.Now().UnixNano()) sleepDuration := time.Duration(rand.Int63n(max-min)+min) * time.Millisecond log.Printf("Sleep duration: %

Re: [go-nuts] Re: Chrome not accepting generate_cert.go self-signed SSL certificate

2016-12-29 Thread Marcus Franke
Chrome, like the other browsers use your systems certificate store. Just import the root CA's certificate and you will have a valid chain of trust. Darren Hoo schrieb am Do., 29. Dez. 2016, 09:04: > Try starting chrome from command line with option --ignore-certificate-errors > ? > > > On Friday

[go-nuts] How to invoke methods with variant interface when you have array of interface?

2016-12-29 Thread Dave Cheney
Like this: ver s string var args []interface fn(s, args...) https://golang.org/ref/spec#Passing_arguments_to_..._parameters -- 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 a

[go-nuts] Re: How has your company adopted Go ?

2016-12-29 Thread Haddock
This thread is very interesting to me as I'm working exclusively with Java and am looking for ways to bring in other approaches such as using Go. Could some of you drop some few lines in what way in your company Java is combined with Go? That would give me an idea where to start experimenting i

[go-nuts] How to invoke methods with variant interface when you have array of interface?

2016-12-29 Thread jishnu
I am newbie in Go please bear with me I have to invoke a method in another package *someFunc(query string, args ...interface{})* I have 2 variable of type *string ,[]interface{} *Is it possible to invoke the above method? If yes how? Regards Jishnu -- --

[go-nuts] Re: Chrome not accepting generate_cert.go self-signed SSL certificate

2016-12-29 Thread Darren Hoo
Try starting chrome from command line with option --ignore-certificate-errors ? On Friday, March 13, 2015 at 7:19:07 PM UTC+8, Alex wrote: > > > I made a certificate with the generate_cert.go file in the http package, > and it works fine on firefox, but chrome wont accept it (with no options to