Re: [go-nuts] Re: correct/working 9p2000 library in Go?

2017-02-23 Thread David Arroyo
I'm the author of this one[1], and I hate to contribute to the OP's initial complaint, but it is not complete. I plan to make it as easy to use as net/http, but I can only find so much time to work on it. I've also fixed a number of bugs that arose from my misunderstanding of the protocol, so it wo

Re: [go-nuts] Re: NewTicker function example

2017-02-23 Thread Sebastien Binet
On Thu, Feb 23, 2017 at 12:37 PM, Nathan Kerr wrote: > 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

[go-nuts] Re: NewTicker function example

2017-02-23 Thread Nathan Kerr
The example I gave already runs forever. No need for select. As for daemonization, I have had good luck with github.com/jpillora/overseer . On Friday, February 24, 2017 at 1:22:36 AM UTC+1, Keith Brown wrote: > > Thank You all for the great examples! > > I added a select {} at the end so the prog

[go-nuts] Passing Already Accepted Connection to http.Serve()

2017-02-23 Thread henry . f . camacho
I am attempting to pass an already accepted connection to http.Serve(). I need to preview the connection allowing inspection of type of traffic appearing on a single port. The desire is to handle a number of types of connections to a single port. I'll preview the traffic, determine what type i

Re: [go-nuts] offset out of range, different toolchain

2017-02-23 Thread jonathan . gaillard
phew thx, thought I was going crazy there. On Thursday, February 23, 2017 at 5:27:22 PM UTC-8, Ian Lance Taylor wrote: > > On Thu, Feb 23, 2017 at 12:54 PM, > > wrote: > > I am trying to switch from a 32 bit standalone ndk android toolchain to > the > > 64 bit one. The only changes I have mad

Re: [go-nuts] 1.8 plugins and ABI

2017-02-23 Thread 'Tim Hockin' via golang-nuts
Thanks, Ian. Very informative if somewhat disappointing. It more or less rules out what we wanted to do. On Feb 23, 2017 5:23 PM, "Ian Lance Taylor" wrote: On Thu, Feb 23, 2017 at 4:45 PM, 'Tim Hockin' via golang-nuts wrote: > > I can't seem to find this documented, and I'm me involved in so

Re: [go-nuts] Support for the race detector on ARM

2017-02-23 Thread Ian Lance Taylor
[ +dvyukov ] On Thu, Feb 23, 2017 at 1:34 PM, Owen Waller wrote: > Hi Ian, > > Go's race detector is based on and uses Thread Sanitizer, which has > only been implemented for amd64. I'm not aware of any effort to > extend thread sanitizer to other processors. That would have been > done before

Re: [go-nuts] offset out of range, different toolchain

2017-02-23 Thread Ian Lance Taylor
On Thu, Feb 23, 2017 at 12:54 PM, wrote: > I am trying to switch from a 32 bit standalone ndk android toolchain to the > 64 bit one. The only changes I have made are the toolchain and using > GOARCH=arm64 instead of GOARCH=arm when build but I am getting a list of > errors like: > > internal/**/*

Re: [go-nuts] 1.8 plugins and ABI

2017-02-23 Thread Ian Lance Taylor
On Thu, Feb 23, 2017 at 4:45 PM, 'Tim Hockin' via golang-nuts wrote: > > I can't seem to find this documented, and I'm me involved in some > conversations about using plugins: > > What guarantees or limitations surround plugins? Can I compile a host > program with go-1.8.0 and have a third-party

[go-nuts] 1.8 plugins and ABI

2017-02-23 Thread 'Tim Hockin' via golang-nuts
Hi all, I can't seem to find this documented, and I'm me involved in some conversations about using plugins: What guarantees or limitations surround plugins? Can I compile a host program with go-1.8.0 and have a third-party plugin compiled with 1.8.1, and load it? Can I call methods on plugin-s

[go-nuts] Re: NewTicker function example

2017-02-23 Thread Keith Brown
Thank You all for the great examples! I added a select {} at the end so the program will run forever. I am trying to have it as a deamon. On Thursday, February 23, 2017 at 6:37:12 AM UTC-5, Nathan Kerr wrote: > > NewTicker function example > > The task of running functions on a periodic basis

RE: [go-nuts] Debugging long GC pauses

2017-02-23 Thread John Souvestre
Or… Call runtime.Gosched(). I seem to recall benchmarking it a while back and found that it was very efficient. John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Jesper Louis Andersen Sent: 2017 February 23, T

Re: [go-nuts] Debugging long GC pauses

2017-02-23 Thread Jesper Louis Andersen
What would happen if you inserted a dummy function call inside the non-preemptible loop and made an appropriate sacrifice on the altar of the SSA dead-code-eliminator so it doesn't trigger? On Thu, Feb 23, 2017 at 8:46 PM 'Austin Clements' via golang-nuts < golang-nuts@googlegroups.com> wrote: >

Re: [go-nuts] Support for the race detector on ARM

2017-02-23 Thread Owen Waller
Hi Ian, > > Go's race detector is based on and uses Thread Sanitizer, which has > only been implemented for amd64.  I'm not aware of any effort to > extend thread sanitizer to other processors.  That would have been > done before there is any likelihood of Go supporting it. > > Ian Thanks for th

Re: [go-nuts] Adding support for session ID-based TLS session reuse

2017-02-23 Thread Igor Gatis
What is the current status? Is session ID supported? I agree session ticket is the way to go. But it is useful for old TLS client implementations. I have 10k terminals which do HTTPS requests over gprs. TLS handshake alone costs ~4s. With ip-based server affinity and session ID support, latency

[go-nuts] offset out of range, different toolchain

2017-02-23 Thread jonathan . gaillard
I am trying to switch from a 32 bit standalone ndk android toolchain to the 64 bit one. The only changes I have made are the toolchain and using GOARCH=arm64 instead of GOARCH=arm when build but I am getting a list of errors like: internal/**/**.go:715: offset out of range: 782 01448 (/go/src/*

Re: [go-nuts] Debugging long GC pauses

2017-02-23 Thread 'Austin Clements' via golang-nuts
AFAIK, the only thing that can cause this in Go 1.8 is a non-preemptible loop. It's not related to the heap size at all. To test this theory, you can set GOEXPERIMENT=preemptibleloops and rebuild your Go tree (the compiler has to be built with this, so you can't just turn it on to build your proje

Re: [go-nuts] Support for the race detector on ARM

2017-02-23 Thread Ian Lance Taylor
On Thu, Feb 23, 2017 at 9:45 AM, Owen Waller wrote: > > I am assuming that the race detector is not yet supported on ARM hardware. > Having just tried to cross compile some code I am seeing: > > go build: -race and -msan are only supported on linux/amd64, freebsd/amd64, > darwin/amd64 and windows/

Re: [go-nuts] Debugging long GC pauses

2017-02-23 Thread Caleb Spare
+rlh, austin Interesting behavior. I would recommend filing a bug. It would be most helpful if you can create a complete repro case including either the production code or some minimization of it that demonstrates the same pauses. On Thu, Feb 23, 2017 at 10:46 AM, Oliver Beattie wrote: > I am lo

[go-nuts] Debugging long GC pauses

2017-02-23 Thread Oliver Beattie
I am looking for some advice about how I can debug some long GC pauses I am observing in our production workloads under go 1.8 (the problem is not specific to 1.8, though). This is a very simple network server – basically a HTTP ping endpoint – but I regularly see tail request latencies of >100

[go-nuts] Support for the race detector on ARM

2017-02-23 Thread Owen Waller
Hi Everyone, I am assuming that the race detector is not yet supported on ARM hardware. Having just tried to cross compile some code I am seeing: go build: -race and -msan are only supported on linux/amd64, freebsd/amd64, darwin/amd64 and windows/amd64. The 1.8 docs back this up as well. Does a

Re: [go-nuts] Using the Plugin Feature in Go 1.8

2017-02-23 Thread Ian Lance Taylor
On Thu, Feb 23, 2017 at 5:24 AM, dc0d wrote: > Is the plugin feature in Go 1.8, production ready? > > Or is it experimental? On slack Andrei Tudor Călin led me to the list of > current issues with plugins, which is somehow daunting. BTW even providing > just functions (by means of plugins), seems

Re: [go-nuts] Beginner Question : Reassignment of counter variable inside for loop in https://github.com/golang/mobile/tree/master/example/flappy

2017-02-23 Thread Victor Kovacs
Ah Thanks. Sorry i missed it in the FAQ. -- 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:

Re: [go-nuts] Why dont the Marshal & Unmarshal use same amount of arguments and return values

2017-02-23 Thread Ian Lance Taylor
On Thu, Feb 23, 2017 at 4:42 AM, Jianhua Li wrote: > func Marshal(v interface{}) ([]byte, error) > > func Unmarshal(data []byte, v interface{}) error > > > Why dont the Marshal & Unmarshal use same amount of arguments, and same > amount of return values like one of these. > > > //1. > > func Marsh

[go-nuts] Re: Why dont the Marshal & Unmarshal use same amount of arguments and return values

2017-02-23 Thread Jianhua Li
i meant the json library > On 23 Feb 2017, at 20:42, Jianhua Li wrote: > > func Marshal(v interface{}) ([]byte, error) > func Unmarshal(data []byte, v interface{}) error > > Why dont the Marshal & Unmarshal use same amount of arguments, and same > amount of return values like one of these. >

[go-nuts] bombardier - Fast cross-platform HTTP benchmarking tool written in Go

2017-02-23 Thread max . faceless . frei
https://github.com/codesenberg/bombardier I just released a v1.0 of my benchmarking tool. If you have been looking for a *wrk*/*weighttp *replacement for Windows or want something more performant than, say, *ab*/*siege*/*hey*/*vegeta*

[go-nuts] Why dont the Marshal & Unmarshal use same amount of arguments and return values

2017-02-23 Thread Jianhua Li
func Marshal(v interface{}) ([]byte, error) func Unmarshal(data []byte, v interface{}) error Why dont the Marshal & Unmarshal use same amount of arguments, and same amount of return values like one of these. //1. func Marshal(data[]byte, v interface{}) (error) func Unmarshal(data []byte, v inter

Re: [go-nuts] Developing Microservices

2017-02-23 Thread adrian . price
I'm not sure there's anything go-specific other than libraries and frameworks; just general good practices. One of the best things I can recommend to keep microservices from becoming a mess is to treat every service like it's external: - Have a well-defined, versioned API contract for each servi

[go-nuts] Re: correct/working 9p2000 library in Go?

2017-02-23 Thread Kare Nuorteva
Here's one that I found just recently: https://blog.aqwari.net/9P/ Cheers, Kare sunnuntai 19. helmikuuta 2017 19.39.18 UTC+2 Jason E. Aten kirjoitti: > > I'd like to play with the 9p protocol (plan9's "everything is a > filesystem" IPC protocol; I guess the updated 9p2000 version is the one >

Re: [go-nuts] Re: Unsafe string/slice conversions

2017-02-23 Thread Caleb Spare
That only applies to []byte. I have a []uint64. On Feb 23, 2017 4:13 AM, "T L" wrote: > > > On Wednesday, February 22, 2017 at 6:53:53 AM UTC+8, Caleb Spare wrote: >> >> I have a program that uses unsafe in order to coerce some slices to >> strings for use as map keys. (Avoiding these allocation

Re: [go-nuts] Developing Microservices

2017-02-23 Thread dc0d
Thanks Nyah! But that's a framework for developing microservices and I'm already using one; NATS (although it's more low level). What I'm looking for is the "development tools"/process/practices that helps in the "process of developing" (not designing or implementing) a microservices architectu

Re: [go-nuts] Re: Building Go from Source / Managing my ${GOROOT}

2017-02-23 Thread Steve Mynott
Peter, That will no longer work in go 1.8 since GOPATH is set to $HOME/go by default and what you describe will also set GOROOT to the same directory and the two environment variables have to point at different directories. ("go env" is useful for debugging this) One solution is "git clone https

Re: [go-nuts] Developing Microservices

2017-02-23 Thread Nyah Check
This should help: https://github.com/micro On Thu, Feb 23, 2017 at 2:17 PM, dc0d wrote: > How do you develop a microservice based (architecture) app? I have some > scripts that are doing the building, starting and stopping and also running > tests. But do you use any specific tools for developin

[go-nuts] Using the Plugin Feature in Go 1.8

2017-02-23 Thread dc0d
Is the plugin feature in Go 1.8, production ready? Or is it experimental? On slack Andrei Tudor Călin led me to the list of current issues with plugins, which is somehow daunting. BTW even providing just

[go-nuts] Developing Microservices

2017-02-23 Thread dc0d
How do you develop a microservice based (architecture) app? I have some scripts that are doing the building, starting and stopping and also running tests. But do you use any specific tools for developing microservices? - Env: Apps are communicating via NATS (& some HTTP), Go 1.8, Ubuntu 14.04 (

Re: [go-nuts] Reflection: Constructing a struct type that satisfies an interface

2017-02-23 Thread 'Axel Wagner' via golang-nuts
>From what I know, a) with the normal protobuf package, you can not en- or decode and then reflect messages by the proto descriptor, you need to compile in the generated code - adding methods to a reflect-created struct alone doesn't help, as the package also has some assumptions about the represen

Re: [go-nuts] Reflection: Constructing a struct type that satisfies an interface

2017-02-23 Thread Ivan Vučica
What I want, in the end, is to send a gRPC request based on an ASCII or JSON representation of a protobuf, receive a response and display it. Essentially, if you take grpc_cli tool present in the repo of C implementation of gRPC, I would like to implement its "call" functionality. Even though try

[go-nuts] Re: Unsafe string/slice conversions

2017-02-23 Thread T L
On Wednesday, February 22, 2017 at 6:53:53 AM UTC+8, Caleb Spare wrote: > > I have a program that uses unsafe in order to coerce some slices to > strings for use as map keys. (Avoiding these allocations ends up being > an important performance optimization to this program.) > > Here's some exa

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 > be

[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 timing

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

2017-02-23 Thread Nathan Kerr
I assume you mean that you didn't know that json.Unmarshal would call *LimitOrder.UnmarshalJSON because *LimitOrder.UnmarshalJSON explicitly calls json.Unmarshal. If so, I also had not realized the significance of the UnmarshalJSON name. This is one

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

2017-02-23 Thread Nathan Kerr
You gave two different things you want to accomplish: 1. “I am trying to read those values and store in DB” 2. “I will populate the struct and provide it the application for consumption” Fortunately accomplishing either or both of these goals follows a similar process. Start by figuring out wh