[go-nuts] Re: Retrieve Unknown Rows & Columns From a MySQL Table (Golang)

2017-09-15 Thread Tamás Gulácsi
for i, v := range vals { fmt.Printf("%d. %v\n",vals[i]) } -- 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...@googlegr

[go-nuts] In CI, if I run `go test -race`, should I bother to also `go test` without -race?

2017-09-15 Thread Tamás Gulácsi
No since the race detector should have no bearing on the correctness of test results. Except for waay bigger VM usage and bigger RSS mem usage. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving em

[go-nuts] Re: Retrieve Unknown Rows & Columns From a MySQL Table (Golang)

2017-09-15 Thread Alexandre K
So, I'm really close to accomplishing my goal. Can anyone help me with the very last command IN THIS CODE??? On Thursday, September 14, 2017 at 4:59:59 PM UTC-7, Alexandre K wrote: > > Hello Everyone, > > I'm new to Golang and I a

[go-nuts] Re: Retrieve Unknown Rows & Columns From a MySQL Table (Golang)

2017-09-15 Thread Alexandre K
So I'm really close to accomplishing my goal. I just need some help converting memory addresses to strings. Can anyone help me with the last command in this code block? package main import ( "database/sql" "fmt" "log" _ "github.com/go-sql-driver/mysql" ) func main() { //Co

[go-nuts] Re: Retrieve Unknown Rows & Columns From a MySQL Table (Golang)

2017-09-15 Thread Alexandre K
So, I'm nearly there. I just need to find out how to print memory addresses as strings. Can anyone help me with the last command on this batch of code package main import ( "database/sql" "fmt" "log" _ "github.com/go-sql-driver/mysql" ) func main() { //Connect to database

Re: [go-nuts] Using commercial SSL certificate with golang server?

2017-09-15 Thread nepdave1
Hey Shawn, Thank you for that. Is there a particular directory where I should keep the certificate? On Friday, September 15, 2017 at 2:34:09 PM UTC-7, Shawn Milochik wrote: > > Sure. It's pretty simple: > https://golang.org/pkg/net/http/#ListenAndServeTLS > > The only caveat is that you may ha

Re: [go-nuts] Using Nginx with go?

2017-09-15 Thread Shawn Milochik
On Sep 15, 2017 13:15, wrote: Hey! That worked! Thank you, Shawn. Much appreciated. You're welcome! Kudos to you for not just being lazy and running as root. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and s

Re: [go-nuts] Using commercial SSL certificate with golang server?

2017-09-15 Thread Shawn Milochik
Sure. It's pretty simple: https://golang.org/pkg/net/http/#ListenAndServeTLS The only caveat is that you may have more than two files. If that's the case, then you will have to combine your certificate and GoDaddy's chain certificate into a single file and use that as your certificate file. -- Y

[go-nuts] Using commercial SSL certificate with golang server?

2017-09-15 Thread nepdave1
Hello, I purchased an SSL certificate from godaddy.com. I was able to successfully download the certificate onto my laptop, right now it's just sitting in my downloads folder in a zip file. Godaddy has instructions on how to upload the certificate to NGINX or Apache, however, I think uploading

Re: [go-nuts] `ltrace` yields "Couldn't find .dynsym or .dynstr in "/proc/*/exe" with binaries generated by "go build *.go"

2017-09-15 Thread Sen Han
Thanks for your information. I want to use `ltrace` to find out if the golang binary is using the __vdso_clock_gettime_sym with CLOCK_MONOTONIC option for measuring time interval. But it finally turns out currently the `ltrace` cannot works very well with go built binaries on vdso tracing. Is the

[go-nuts] In CI, if I run `go test -race`, should I bother to also `go test` without -race?

2017-09-15 Thread mark
In CI, if we're going to run unit tests under the race detector, is there any value in running unit tests again _without_ the race detector? I'm inclined to say yes, since in production customers won't be running with the race detector enabled; but it feels like the answer should be no since t

[go-nuts] context cancellation flake

2017-09-15 Thread Tamás Gulácsi
You "readBody" after "defer cancel()", so response length amd caching may provide you a body, maybe just a canceled context. -- 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

Re: [go-nuts] Do you check in vendor packages?

2017-09-15 Thread Will Faught
Kevin, Henrik: Thanks for replying! Have you ever had to check in very large dependencies? Would you still do it if just one dep added 30 MB to your 10 MB repo? What if the size of your code is dwarfed by the size of your deps 10:1? I'm curious how far people are willing to go to check in their d

Re: [go-nuts] Panic with runtime cgo and go

2017-09-15 Thread webuser1200
Thanks and Sorry for not providing more details. I'm on 1.9. No unsafe package is used. Main program is a c program which calls into go functions where some analytics are performed. All calls to the golang use only strings and ints/floats/char. No structs are passed. In Go all strings are conv

[go-nuts] Re: DNS problem and cross-compile to GOOS=android|linux GOARCH=arm + CC=

2017-09-15 Thread Elias Naur
On Friday, September 15, 2017 at 7:15:25 PM UTC+2, ulde...@strongdm.com wrote: > Hi, > > > It fails when I run: > ``` > CC="${GOPATH}/android-ndk/bin/arm-linux-androideabi-gcc" GOOS=android > GOARCH=arm GOARM=7 go build > # github.com/ucirello/android-test > warning: unable to find runtime/cgo.a

Re: [go-nuts] Panic with runtime cgo and go

2017-09-15 Thread Ian Lance Taylor
On Fri, Sep 15, 2017 at 7:30 AM, wrote: > > This program runs for about an hour and consumes about 1Gig of memory. I was > getting a lot of these errors, but they were significantly reduced when I > reduced the golang memory usage. (by reducing the in memory state that I > was keeping) > > Any i

[go-nuts] DNS problem and cross-compile to GOOS=android|linux GOARCH=arm + CC=

2017-09-15 Thread ulderico
Hi, I think I am skipping something obvious - but I really can't understand what. I looked both in Github and in golang-nuts for information. I want to make a CLI app in Go to run in Android's Termux. I have Android NDK's installed and configured. When I run: ``` CC="${GOPATH}/android-ndk/bin

[go-nuts] context cancellation flake

2017-09-15 Thread kynrai
Hello, I was wondering if anyone could help me with understanding the behaviour of cancelling context on a request before its read. I am using golang 1.9 on macOS X sierra (latest) Sometimes this code returns context cancelled, sometimes it works. package main import ( "context" "io/i

Re: [go-nuts] Using Nginx with go?

2017-09-15 Thread dstreckert
Hey! That worked! Thank you, Shawn. Much appreciated. On Friday, September 15, 2017 at 7:24:16 AM UTC-7, Shawn Milochik wrote: > > You don't need to use nginx. You *can* if you want to serve multiple > domains from the same IP, or terminate TLS there, or have nginx handle > static data from dis

Re: [go-nuts] Timestamp issues

2017-09-15 Thread Marvin Renich
* xana...@gmail.com [170915 12:33]: > Yes, I have also tried this on separate devices and some were off and some > were exact to the second so this is definitely a frontend therefore > javascript issue and not an issue with golang. Not sure how to fix it but > this is not a question for golang-

Re: [go-nuts] Remove GOPATH from binary

2017-09-15 Thread David Crawshaw
This may be https://golang.org/issue/21720. Does it work with Go 1.8? On Fri, Sep 15, 2017 at 12:48 AM, Chandru wrote: > How do I remove the actual value of GOPATH from executable binary? > > I tried the following command, but my home directory continued to appear > when I ran strings on the bina

[go-nuts] Re: Why is Shiny's text rendering quantizes to the pixel grid?

2017-09-15 Thread David Crawshaw
On Fri, Sep 15, 2017 at 7:35 AM, Elias Naur wrote: > Hi, > > Working on a immediate mode fork of Shiny, Neat. > I ran into this comment: > > // We round up the ascent and descent separately, instead of asking for > // the metrics' height, since we quantize the baseline to the integer > // pixel

[go-nuts] Re: Panic with runtime cgo and go

2017-09-15 Thread webuser1200
Some other errors that I've gotten from the the same program. > fatal error: unexpected signal during runtime execution > runtime: pointer 0xc43d78cba0 to unallocated span idx=0xebc6 > span.base()=0xbdf102 span.limit=0xbdf102 span.state=0 > runtime: found in object at *(0xc44474+0x

Re: [go-nuts] Timestamp issues

2017-09-15 Thread Marvin Renich
* xana...@gmail.com [170915 03:16]: > No the clients are connected to this app through websockets, they are using > javascript, following snippet is used to make the countdown: > let timeLeft = Math.ceil(((timestamp * 1000) - new Date().getTime()) / 1e3) Okay, so the clients are on different mac

[go-nuts] Panic with runtime cgo and go

2017-09-15 Thread webuser1200
This program runs for about an hour and consumes about 1Gig of memory. I was getting a lot of these errors, but they were significantly reduced when I reduced the golang memory usage. (by reducing the in memory state that I was keeping) Any idea on how I can go about debugging this? -

Re: [go-nuts] Using Nginx with go?

2017-09-15 Thread Shawn Milochik
You don't need to use nginx. You *can* if you want to serve multiple domains from the same IP, or terminate TLS there, or have nginx handle static data from disk. You can listen on port 80 if you do this: sudo /sbin/setcap cap_net_bind_service=+ep yourBinary -- You received this message because

[go-nuts] Using Nginx with go?

2017-09-15 Thread nepdave1
Do you have to use Nginx or apache with your go web app? I know web apps run on port 80 but I'm unable to run my app on port 80. Currently I'm using port 8000 and to access my website I'm putting in the IP address and port number in the browser. I thought a plus of using go was that you didn't

Re: [go-nuts] `ltrace` yields "Couldn't find .dynsym or .dynstr in "/proc/*/exe" with binaries generated by "go build *.go"

2017-09-15 Thread Konstantin Khomoutov
On Fri, Sep 15, 2017 at 04:09:24AM -0700, nehs...@gmail.com wrote: > Hi, I just found `ltrace` would yield "Couldn't find .dynsym or .dynstr in > "/proc/*/exe" with executable binary generated by "go build *.go". > > Is there any options in `go build` could solve this problem? > > Thanks a lot.

Re: [go-nuts] Is this a race detector false positive case

2017-09-15 Thread Jan Mercl
On Fri, Sep 15, 2017 at 3:15 PM wrote: https://stackoverflow.com/q/46233680 -- -j -- 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...@go

Re: [go-nuts] Re: Choosing a framework

2017-09-15 Thread Shawn Milochik
On Fri, Sep 15, 2017 at 7:50 AM, john howitt wrote: > One of my reasons for moving to Go was to escape from frameworks which in > my opinion are a fashion statement not a technology. Slightly mangling the > saying about Regular expressions "I have a problem learning Go", "OK use a > framework", "

[go-nuts] Is this a race detector false positive case

2017-09-15 Thread ruoshan . huang
``` package main func main() { m1 := make(map[string]int) m2 := make(map[string]int) m1["hello"] = 1 go func() { _ = m1["hello"] }() m2["hello"] = 3 m1 = m2 } ``` Race detector detects that line `_= m1["hello"]` and line `m2["hello"] = 3` have race condition. But m1 and m2 is not the same map. A

[go-nuts] Re: Choosing a framework

2017-09-15 Thread john howitt
One of my reasons for moving to Go was to escape from frameworks which in my opinion are a fashion statement not a technology. Slightly mangling the saying about Regular expressions "I have a problem learning Go", "OK use a framework", "Now i have two problems", "You can also use and ORM", "Ah n

[go-nuts] `ltrace` yields "Couldn't find .dynsym or .dynstr in "/proc/*/exe" with binaries generated by "go build *.go"

2017-09-15 Thread nehsnah
Hi, I just found `ltrace` would yield "Couldn't find .dynsym or .dynstr in "/proc/*/exe" with executable binary generated by "go build *.go". Is there any options in `go build` could solve this problem? Thanks a lot. PS: $go version go version go1.9 linux/amd64 $ cat hi.go package main impor

Re: [go-nuts] Choosing a framework

2017-09-15 Thread Tim Uckun
At this point haven't you just built your own framework? You looked around, did some research, read a whole of documentation and decided that this set of components work well together and do what you want. It seems to me that a framework is the exact same thing except that somebody else has c

[go-nuts] Re: Are you tired typing if err != nil {} ?

2017-09-15 Thread ojucie
I use a system wide keyboard macro. That way it works in any editor. Even now, I can type it if err != nil { panic(err) } to insert this little snippet. If all I want is a throw away program, I am done. Otherwise, if I want to keep it, on a later pass I replace the panic with proper error handli

[go-nuts] Why is Shiny's text rendering quantizes to the pixel grid?

2017-09-15 Thread Elias Naur
Hi, Working on a immediate mode fork of Shiny, I ran into this comment: // We round up the ascent and descent separately, instead of asking for // the metrics' height, since we quantize the baseline to the integer // pixel grid. For example, if ascent and descent were both 3.2 pixels, // then the

Re: [go-nuts] Re: Bytconv where art thou

2017-09-15 Thread roger peppe
I suspect that this kind of performance issue may be fixed by better compiler optimisation in the future (I think should be possible for the compiler to notice that the string doesn't escape and pass a pointer to the byte slice as the string argument). On 15 September 2017 at 10:36, Peter Waller

Re: [go-nuts] Re: Bytconv where art thou

2017-09-15 Thread Peter Waller
Because of the immutability of the string, constructing a string on a byte slice requires allocating and copying the bytes. Once you've got the string, it's "free" to pass around. If you've already got strings, everything is fine. But if you're reading the data from IO, you're probably starting wi

[go-nuts] Re: how to sort http.Header by ourselves

2017-09-15 Thread Dave Cheney
The author replied to their own post saying that header order was probably not the issue, and give the HTTP RFCs define headers to be an unordered set not an array, I'm inclined to agree. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsub

Re: [go-nuts] Re: Using dep tool behind proxy with mix of internal/external deps

2017-09-15 Thread Konstantin Khomoutov
On Thu, Sep 14, 2017 at 08:36:50PM +, Justin Israel wrote: > > I asked this on a relevant dep tool issue > > but I haven't heard a reply > > and wanted to see if anyone here has some insight... [...] > Where are people having discussions about the dep