Re: [go-nuts] Go UDP performance

2017-02-22 Thread Tharaneedharan Vilwanathan
Hi All, Sorry for the delay. I remembered I got better UDP performance in another system. So I had to track it. First, please find the code at the end of this mail. - Version: I used go 1.7.1 - Platform: Ubuntu 16.10 on x86_64 (I used two setups. In one, I used i7 Skull Canyon NUC and in the

[go-nuts] playgo - CLI tool to send .go file to the Go Playground

2017-02-22 Thread pltvs
Usually when we share a runnable Go code we do: copy code, open Go Playground, paste code, click Share. So playgo does it for you. go get -u github.com/plutov/playgo/cmd/playgo playgo helloworld.go https://play.golang.org/p/v3rrZLwEUC -- You received this

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

2017-02-22 Thread Matt Harden
Is the intermediate Go struct necessary, or do you just want to convert a text proto to a binary representation? On Wed, Feb 22, 2017 at 6:10 PM wrote: > Hi, > > I'm fiddling with gRPC and its service reflection. I discovered a neat > package (github.com/jhump/protoreflect)

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

2017-02-22 Thread ivucica
Hi, I'm fiddling with gRPC and its service reflection. I discovered a neat package (github.com/jhump/protoreflect) that let me quickly enumerate the services that are exposed by the gRPC server, the RPCs that are in those gRPC services, and finally the proto messages that are used as inputs

[go-nuts] Re: NewTicker function example

2017-02-22 Thread Rodolfo Azevedo
You can use sync WaitGroup too https://play.golang.org/p/bb3a6t1N-C But WILL NOT WORK ON playground, because of limitations of time package on playground. Regards. Em quarta-feira, 22 de fevereiro de 2017 21:39:12 UTC-4, Keith Brown escreveu: > > Oddly, I can't find a single example on the

[go-nuts] Re: NewTicker function example

2017-02-22 Thread Rodolfo Azevedo
Like this? https://play.golang.org/p/rXPl7Bco0c Em quarta-feira, 22 de fevereiro de 2017 21:39:12 UTC-4, Keith Brown escreveu: > > Oddly, I can't find a single example on the world wide web for what I am > trying to do. > > I have 2 functions which I want to run on a periodic basis. The

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

2017-02-22 Thread Diogo Ribeiro
Thanks Nathan, it worked. I didn't know that *LimitOrder.UnmarshalJSON would call json.Unmarshal. Em terça-feira, 21 de fevereiro de 2017 05:24:45 UTC-3, Nathan Kerr escreveu: > > I figured it out. > > First off, the posted playground had a different json string and did not > use your

Re: [go-nuts] Can Go run on a calculator?

2017-02-22 Thread Tyler Compton
The TI-84 series uses the z80 instruction set, which isn't a compile target in Go, unfortunately. That's not to say it couldn't be, but I bet there are some more fundamental issues that would make compiling to a TI-84 impossible. I don't think Go supports any 8-bit machines. On Wed, Feb 22, 2017

[go-nuts] NewTicker function example

2017-02-22 Thread Keith Brown
Oddly, I can't find a single example on the world wide web for what I am trying to do. I have 2 functions which I want to run on a periodic basis. The functions are square and cube. Here is my code so far. https://play.golang.org/p/akMxcg2Sra But, I am not sure how to schedule these functions.

[go-nuts] Can Go run on a calculator?

2017-02-22 Thread meyerzinn
I realized today that the TI-84 Plus C *Silver Edition* calculator I have is able to run assembly instructions, and after further Googling and some Wikipedia searches I found out that some C compilers exist. It uses the Zilog Z80 8-bit CPU with 128 KB of RAM (21 KB user accessible) and 4 MB of

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

2017-02-22 Thread Jesse McNelis
On Thu, Feb 23, 2017 at 8:59 AM, Victor Kovacs wrote: > > // The ground. >> for i := range g.groundY { >> i := i >> // The top of the ground. >> newNode(func(eng sprite.Engine, n *sprite.Node, t clock.Time) { >> > > While this solves the issue I would like to understand what

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

2017-02-22 Thread Victor Kovacs
Hi, I've recently started learning go as a way to learn mobile apps and have started experimenting with flappy from the mobile examples (https://github.com/golang/mobile/tree/master/example/flappy) While doing some changes I've run into a problem that I don't understand. The code : for

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

2017-02-22 Thread Latchesar Ionkov
I guess you assume that we are actually checking if there are issues open and closing them when the bugs get fixed. That's definitely not true for my repositories and I am not planning to spend time on this. https://github.com/lionkov/go9p was superseded by https://github.com/lionkov/ninep (I was

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

2017-02-22 Thread Jason E. Aten
Thanks Latchesar. Mr. Minnich notes here https://github.com/Harvey-OS/ninep/issues/21 that, with regards to his fork: > I've been using it for quite some time now and it's been very solid and stable. On Wed, Feb 22, 2017 at 4:30 PM, Latchesar Ionkov wrote: > I guess you

Re: [go-nuts] Linux, Netlink, and Go - Part 1: netlink

2017-02-22 Thread Matt Layher
No special workarounds in my package that I'm aware of! My guess would be that it's inconsistent between netlink families. I've only really played with genetlink and rtnetlink. - Matt On 02/22/2017 05:14 PM, Steven Hartland wrote: Hmm fails with EPERM when we try to listen for CN_IDX_PROC

Re: [go-nuts] Linux, Netlink, and Go - Part 1: netlink

2017-02-22 Thread Steven Hartland
Hmm fails with EPERM when we try to listen for CN_IDX_PROC I guess that may be a special case given what it is. Be interested to know if your module avoids this issue somehow? On 22/02/2017 21:17, Matt Layher wrote: > 1. "Only processes with an effective UID of 0 or the CAP_NET_ADMIN

[go-nuts] Re: Go Compiler Intermediate Representation

2017-02-22 Thread adonovan via golang-nuts
On Tuesday, 21 February 2017 12:23:44 UTC-5, Arpit Aggarwal wrote: > > I am doing a project in which I need Go compiler's intermediate > representation(IR) (which is semantics preserving and I can get all all > info like line number and data type and other features) (human readable) to >

[go-nuts] [ANN] Enhanced Markdown template processor(emd): helper to generate README file

2017-02-22 Thread mhhcbon
Hi, I made this package to spare me some efforts while maintaining README files of my projects. Its a binary written in go which take advantages of text/template to allow dynamic generation of the README file with help of some fine grained helpers. Just check the README file of the project

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

2017-02-22 Thread C Banning
Clean-up example: https://github.com/clbanning/mxj/blob/master/examples/leafnodes.go On Wednesday, February 22, 2017 at 4:31:47 AM UTC-7, C Banning wrote: > > Perhaps not very elegant but seems to produce what you're looking for: > https://play.golang.org/p/bpM69Q-ddV > -- You received this

Re: [go-nuts] Linux, Netlink, and Go - Part 1: netlink

2017-02-22 Thread Matt Layher
> 1. "Only processes with an effective UID of 0 or the CAP_NET_ADMIN capability may send or listen to a netlink multicast group." This appears not to be true, at least in the case of rtnetlink and listening to multicast notifications for link additions and removals.

RE: [go-nuts] Re: Trying to understand := and named return values

2017-02-22 Thread John Souvestre
Ø // Add two numbers Ø Add(x, y int) int Although I support documenting functions as you did above, I feel that this example doesn’t serve your argument well. In this specific case the counter-argument would be that the documentation adds nothing at all to the user’s understanding of

Re: [go-nuts] Re: Golang Messenger Bot frameworks

2017-02-22 Thread Nyah Check
Cool, I'll try that. On Wed, Feb 22, 2017 at 7:36 PM, Diego Medina wrote: > great!, I use their http api directly with Go and works really well. > > On Wed, Feb 22, 2017 at 1:31 PM, Nyah Check wrote: > >> Hi Diego, >> >> Here is the link:

Re: [go-nuts] Re: Golang Messenger Bot frameworks

2017-02-22 Thread Diego Medina
great!, I use their http api directly with Go and works really well. On Wed, Feb 22, 2017 at 1:31 PM, Nyah Check wrote: > Hi Diego, > > Here is the link: https://messengerchallenge.splashthat.com/ > > 2. iric, Facebook uses https://wit.ai/ for their chat bots, and they

[go-nuts] Re: Are relative import paths idiomatic?

2017-02-22 Thread so . query
Ok, Thanks for the answer! On Wednesday, February 22, 2017 at 9:46:26 AM UTC-8, Diego Medina wrote: > > Hi, > > Not recommended, it's better to be explicit by using the full import path, > even if it feels odd at first, other users reading your code will know > exactly where the packages are.

Re: [go-nuts] Re: Golang Messenger Bot frameworks

2017-02-22 Thread Nyah Check
Hi Diego, Here is the link: https://messengerchallenge.splashthat.com/ 2. iric, Facebook uses https://wit.ai/ for their chat bots, and they have > an http API so using regular Go you don't need any sdk/framework > Yeah, I saw that. It appears there's a python API not Go. I'll try the regular

Re: [go-nuts] Linux, Netlink, and Go - Part 1: netlink

2017-02-22 Thread Matt Layher
Sure, I can make a note of this. Almost everything I've done with netlink so far has been read-only, which is probably why I haven't run into any issues. On Wednesday, February 22, 2017 at 1:13:26 PM UTC-5, Steven Hartland wrote: > > One thing you don't mention, which we found particularly

Re: [go-nuts] Linux, Netlink, and Go - Part 1: netlink

2017-02-22 Thread Steven Hartland
One thing you don't mention, which we found particularly frustrating with netlink, is that using it can often need cap_net_admin :( On 22/02/2017 17:38, Matt Layher wrote: Hey all, I recently spent some time working with Linux's netlink IPC mechanism in Go. Because I had a hard time finding

[go-nuts] Linux, Netlink, and Go - Part 1: netlink

2017-02-22 Thread Matt Layher
Hey all, I recently spent some time working with Linux's netlink IPC mechanism in Go. Because I had a hard time finding accurate information about netlink, I decided to do a write-up on some of its fundamental concepts, and how I was able to make use of them from Go. This post focuses on

[go-nuts] Re: Are relative import paths idiomatic?

2017-02-22 Thread Diego Medina
Hi, Not recommended, it's better to be explicit by using the full import path, even if it feels odd at first, other users reading your code will know exactly where the packages are. For more info, see the last two replies here

Re: [go-nuts] Re: Trying to understand := and named return values

2017-02-22 Thread Marvin Renich
* John Souvestre [170222 11:16]: > Ø does it sounds good to disable (in specs) named return vars shadowing ? > > This would help, I don't think this is a good solution. It also breaks Go 1 compatibility. > but the := problem isn’t limited to return variables. > I think

[go-nuts] Re: Golang Messenger Bot frameworks

2017-02-22 Thread Diego Medina
Hi, 1. Would help if you could post a link to the challenge/API 2. iric, Facebook uses https://wit.ai/ for their chat bots, and they have an http API so using regular Go you don't need any sdk/framework Thanks On Wednesday, February 22, 2017 at 8:15:19 AM UTC-5, Nyah Check wrote: > > Hi

Re: [go-nuts] how to locate the function definition of golang source code?

2017-02-22 Thread Ian Lance Taylor
On Wed, Feb 22, 2017 at 12:22 AM, Jiajun Huang wrote: > Hello, I'm reading golang source code, it's in version 1.8. some times, I > got some functions like: (runtime/proc.go, function main): > >107 func main() { >108 g := getg() >109 >110 // Racectx of

Re: [go-nuts] Re: Trying to understand := and named return values

2017-02-22 Thread 'Thomas Bushnell, BSG' via golang-nuts
Function parameters are not a good place (in general - there are exceptions) to document arguments. // Frob the outer otter. FrobOuterOtter(otter Otter) is not better than // Frob the outer otter FrobOuterOtter(Otter) from the standpoint of external documentation. But if you want the function

[go-nuts] Are relative import paths idiomatic?

2017-02-22 Thread so . query
Is it recommended or acceptable to use relative import paths, particularly for nested packages? or should I typically always use the full path? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

[go-nuts] "go clean -i -race" cannot remove pkg files generated by "go build -i -race"

2017-02-22 Thread goofansu
$ go build -i -race -x . WORK=/var/folders/_r/wnjprt2s18v2g9t2cdtt5hs8gn/T/go-build242567175 mkdir -p $WORK/test_viper/_obj/ mkdir -p $WORK/test_viper/_obj/exe/ cd /Users/suyejun/go/src/test_viper /usr/local/Cellar/go/1.8/libexec/pkg/tool/darwin_amd64/compile -o $WORK/ test_viper.a -trimpath

[go-nuts] [ Pimp yourself ] Anyone can solve this?

2017-02-22 Thread tanya - cube
Floyd's Triangle -- 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

[go-nuts] how to locate the function definition of golang source code?

2017-02-22 Thread Jiajun Huang
Hello, I'm reading golang source code, it's in version 1.8. some times, I got some functions like: (runtime/proc.go, function main): 107 func main() { 108 g := getg() 109 110 // Racectx of m0->g0 is used only as the parent of the main goroutine. 111 // It must not be

RE: [go-nuts] Re: Trying to understand := and named return values

2017-02-22 Thread John Souvestre
Ø does it sounds good to disable (in specs) named return vars shadowing ? This would help, but the := problem isn’t limited to return variables. I think that it’s when there are two (or more) variables, and only one is new, that is the real flaw. I would prefer that it only work when both

Re: [go-nuts] Re: Trying to understand := and named return values

2017-02-22 Thread djadala
On Wednesday, February 22, 2017 at 3:39:58 PM UTC+2, Marvin Renich wrote: > > On Tue, Feb 21, 2017 at 1:46 PM, > wrote: > > Seems like named returns + if/for/switch initializers = a shadowing > > nightmare. I wish the Go compiler emitted a loud warning on shadowing,

Re: [go-nuts] Go Windows vs Linux networking stack differences

2017-02-22 Thread Konstantin Khomoutov
On Wed, 22 Feb 2017 04:43:01 -0800 (PST) Luke Mauldin wrote: > One of the things I love about Go is its ability to write code in one > OS and easily cross-compile and deploy that code to another OS. Can > someone help me understand the differences in Windows vs Linux Go >

Re: [go-nuts] Re: Trying to understand := and named return values

2017-02-22 Thread Marvin Renich
On Tue, Feb 21, 2017 at 1:46 PM, wrote: > Seems like named returns + if/for/switch initializers = a shadowing > nightmare. I wish the Go compiler emitted a loud warning on shadowing, as > this is a dangerously subtle problem out there. * Ian Lance Taylor [170221

[go-nuts] Golang Messenger Bot frameworks

2017-02-22 Thread Nyah Check
Hi Gophers, I a looking to participate in the Facebook Messenger Bot challenge. Looking at the API. The recommended bot framework has no golang support. I don't know if any one here knows any good Bot AI frameworks I could use. Inverential Peace, Nyah -- "The heaviest penalty for declining to

[go-nuts] Capital Golang conference

2017-02-22 Thread Rajanikanth Jammalamadaka
Hello Fellow Gophers, Just wanted to let you know about this conference in the Washington DC metro area: https://www.eventbrite.com/e/capital-go-language-conference-2017-tickets-32139266411?aff=es2 Thanks Raj -- You received this message because you are subscribed to the Google Groups

[go-nuts] Go Windows vs Linux networking stack differences

2017-02-22 Thread Luke Mauldin
One of the things I love about Go is its ability to write code in one OS and easily cross-compile and deploy that code to another OS. Can someone help me understand the differences in Windows vs Linux Go networking stack? I know that at the top level they are both the same, just use

Re: [go-nuts] Re: Syscall trouble with parameter handling

2017-02-22 Thread snmed
Hi Konstantin Thanks a lot for your input. You were right about the second parameter and the call to ColInitalize, so now i'm a bit further but still get an error. I will have a closer look on that error and hope i find a solution for it. Cheers snmed Am Mittwoch, 22. Februar 2017 11:58:35

[go-nuts] Re: Syscall trouble with parameter handling

2017-02-22 Thread snmed
Okay thanks anyway Am Mittwoch, 22. Februar 2017 11:51:45 UTC+1 schrieb brainman: > > > Has anyone a hint, what i'm doing wrong with the Call arguments? > > I do not know. Sorry. > > > I think the last parameter is the problematic one, ... > > It looks fine to me. > > Alex > -- You received

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

2017-02-22 Thread C Banning
Perhaps not very elegant but seems to produce what you're looking for: https://play.golang.org/p/bpM69Q-ddV -- 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

Re: [go-nuts] Re: Syscall trouble with parameter handling

2017-02-22 Thread Konstantin Khomoutov
On Tue, 21 Feb 2017 22:55:18 -0800 (PST) snmed wrote: > Has anyone a hint, what i'm doing wrong with the Call arguments? I > think the last parameter is the problematic one, but i can't figure > out how to pass that argument. A couple of ideas: * [1] Features a

[go-nuts] Re: Syscall trouble with parameter handling

2017-02-22 Thread brainman
> Has anyone a hint, what i'm doing wrong with the Call arguments? I do not know. Sorry. > I think the last parameter is the problematic one, ... It looks fine to me. Alex -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

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

2017-02-22 Thread Bharath B
Hi, Thanks for the response. Below is the sample json being used, { "jsondata": [ { "dataReference":[ { "parameterType" : "common", "applicationtype": { "application1": { "applicationName": "appl1",