Re: [go-nuts] Passing []byte from golang to char * C.

2017-06-14 Thread Aditi Bhiwaniwala
the error occur because there is 0 in my byte array . Do i need to encode it then? On Wed, Jun 14, 2017 at 9:16 PM, andrey mirtchovski wrote: > can you show us a complete example with a stub C function? in > particular the conversion to (*C.char) from unsafe.Pointer([0])

Re: [go-nuts] Re: [golang-dev] Go 1.9 Beta 1 is released

2017-06-14 Thread Michael Hudson-Doyle
Do you use -skip_tests though? Because I'd be surprised if you don't and don't hit that issue. But maybe I'm missing something. On 15 June 2017 at 13:35, Brad Fitzpatrick wrote: > We use golang.org/x/build/cmd/release > > > On Wed, Jun 14, 2017 at 6:32 PM, Michael

Re: [go-nuts] Re: [golang-dev] Go 1.9 Beta 1 is released

2017-06-14 Thread Brad Fitzpatrick
We use golang.org/x/build/cmd/release On Wed, Jun 14, 2017 at 6:32 PM, Michael Hudson-Doyle < michael.hud...@canonical.com> wrote: > I'm curious how you built your binaries with https://github.com/ > golang/go/issues/20284 still open. Do you not run the tests on the built > binaries before

[go-nuts] Re: [golang-dev] Go 1.9 Beta 1 is released

2017-06-14 Thread Michael Hudson-Doyle
I'm curious how you built your binaries with https://github.com/golang/go/issues/20284 still open. Do you not run the tests on the built binaries before packing them up? On 15 June 2017 at 10:15, Chris Broadfoot wrote: > Hello gophers, > > We have just released go1.9beta1, a

Re: [go-nuts] Re: [Assembler] How can I call SIMD immediate by FP?

2017-06-14 Thread Meng Zhuo
You mean the intrinsic library of C/C++ just extend macro? What a pity. 'Keith Randall' via golang-nuts : > The immediate goes first, like this: > > SHUFPD $1, X1, X2 > > Note that SHUFPD takes an immediate for the shuffle - I don't see how you > can implement the

Re: [go-nuts] Re: Go 1.9 Beta 1 is released

2017-06-14 Thread Brad Fitzpatrick
Correct. https://github.com/golang/go/issues/19082 remains open. See https://dev.golang.org/release for the other bugs not yet fixed. On Wed, Jun 14, 2017 at 5:03 PM, Ben Shi wrote: > still no aarch64 prebuilt binary? > > Ben Shi > > 在 2017年6月15日,06:15,Chris Broadfoot

[go-nuts] Re: Go 1.9 Beta 1 is released

2017-06-14 Thread Ben Shi
still no aarch64 prebuilt binary? Ben Shi > 在 2017年6月15日,06:15,Chris Broadfoot 写道: > > Hello gophers, > > We have just released go1.9beta1, a beta version of Go 1.9. > It is cut from the master branch at the revision tagged go1.9beta1. > > There are no known problems or

Re: [go-nuts] Create methods for structs at runtime

2017-06-14 Thread Kevin Malachowski
Maybe I'm missing something obvious, but why do you need to do this? Seems like some sort of remote dependency injection which requires you to serialize code from the server to the client. Why not just release a compiled client binary which has all of the implementations compiled in already,

Re: [go-nuts] Create methods for structs at runtime

2017-06-14 Thread Dat Huynh
Hi, What I want is to use interfaces to describe services for client side of my app. Then, I implement the services on the server side and allow client side to call the services via my pre-defined protocol (e.g HTTP, ...) In Java, I used the method newProxyInstance( ) of the class

[go-nuts] Re: [Assembler] How can I call SIMD immediate by FP?

2017-06-14 Thread 'Keith Randall' via golang-nuts
The immediate goes first, like this: SHUFPD $1, X1, X2 Note that SHUFPD takes an immediate for the shuffle - I don't see how you can implement the function you want; it takes a dynamic shuffle argument. Unless you do a switch on all possible values of the immediate. On Tuesday, June 13, 2017

[go-nuts] Go 1.9 Beta 1 is released

2017-06-14 Thread Chris Broadfoot
Hello gophers, We have just released go1.9beta1, a beta version of Go 1.9. It is cut from the master branch at the revision tagged go1.9beta1. There are no known problems or regressions. Please try running production load tests and your unit tests with the new version. Report any problems using

[go-nuts] Re: KVs store for large strings

2017-06-14 Thread Robert Johnstone
I'm surprised that the memory overhead is significant - 100 MB is not that much. Assuming that you don't need atomic updates to the entire KV store, partition the keys. Does the periodic reload involve changing the keys? If not, you could map the dataset into nested structs. However, you

Re: [go-nuts] KVs store for large strings

2017-06-14 Thread Kiki Sugiaman
Try boltdb. - supports disk persistence - no read lock for read-only ops - fast key iteration (only as fast as O(n) can be) - probably will translate 100MB raw into 200MB-ish actual utilization, but see for yourself - no cgo https://github.com/boltdb/bolt On 15/06/17 04:45, James Pettyjohn

Re: [go-nuts] Fast string sorting

2017-06-14 Thread Stefan Nilsson
I added a function radix.SortSlice similar to sort.Slice. Instead of a comparison function, it takes a function that serves the relevant strings: // SortSlice sorts a slice according to the strings returned by str. func SortSlice(slice interface{}, str func(i int) string) { The performance

Re: [go-nuts] Re: chidley: XML to Go structs

2017-06-14 Thread Shrinkhala Singhania
Hi, I tried running my XML file and throws this error: chidley$chidley -W xml/openconfig.xml > examples/oc/openconfig1.go chidley$cd examples/oc/ oc$go build # github.com/gnewton/chidley/examples/oc ./openconfig1.go:3361: Chiroot redeclared in this block previous

[go-nuts] KVs store for large strings

2017-06-14 Thread James Pettyjohn
I have an application which has all of it's text, multiple languages, stored in XML on disk that is merged into templates on the fly. About 100MB. Templates use dozens of strings for each render. Currently this is loaded in full into memory in a bunch of tier hash maps. They are lazy loaded

Re: [go-nuts] Re: chidley: XML to Go structs

2017-06-14 Thread Shrinkhala Singhania
That worked. Thanks. Regards, Shrinkhala On Wed, Jun 14, 2017 at 2:22 PM, Ian Lance Taylor wrote: > On Wed, Jun 14, 2017 at 11:08 AM, wrote: > > I have this in my bash_profile: > > > > export PATH=/usr/local/bin:/usr/local/sbin:$PATH > > > >

Re: [go-nuts] Re: chidley: XML to Go structs

2017-06-14 Thread Ian Lance Taylor
On Wed, Jun 14, 2017 at 11:08 AM, wrote: > I have this in my bash_profile: > > export PATH=/usr/local/bin:/usr/local/sbin:$PATH > > export GOPATH = /Users/ssinghania/go/ > > export CLASSPATH=".:/usr/local/lib/antlr-4.6-complete.jar:$CLASSPATH" OK, so do what I

Re: [go-nuts] Re: chidley: XML to Go structs

2017-06-14 Thread singhania . shrink
I have this in my bash_profile: export PATH=/usr/local/bin:/usr/local/sbin:$PATH *export GOPATH = /Users/ssinghania/go/* export CLASSPATH=".:/usr/local/lib/antlr-4.6-complete.jar:$CLASSPATH" On Wednesday, June 14, 2017 at 1:53:53 PM UTC-4, Ian Lance Taylor wrote: > > On Wed, Jun 14, 2017 at

Re: [go-nuts] Re: chidley: XML to Go structs

2017-06-14 Thread Shrinkhala Singhania
I have this in my bash_profile: export PATH=/usr/local/bin:/usr/local/sbin:$PATH *export GOPATH = /Users/ssinghania/go/* export CLASSPATH=".:/usr/local/lib/antlr-4.6-complete.jar:$CLASSPATH" Regards, Shrinkhala On Wed, Jun 14, 2017 at 1:53 PM, Ian Lance Taylor wrote: > On

Re: [go-nuts] Re: chidley: XML to Go structs

2017-06-14 Thread Ian Lance Taylor
On Wed, Jun 14, 2017 at 10:19 AM, wrote: > > To install chidley, I did the following: > > go get github.com/gnewton/chidley > > This worked. However, issue on > > > chidley -W xml/test1.xml > examples/test/ChildTest1.go > > -bash: chidley: command not found > > How do

Re: [go-nuts] Why *cookie and cookie variables returns the cookie in different format upon printing it to terminal?

2017-06-14 Thread Ayan George
Well -- I was wrong. I got it backwards. There is a String() function is a receiver for *http.Cookie so it gets called when you need a string representation of a *http.Cookie (pointer to http.Cookie). On Wed, Jun 14, 2017 at 1:18 PM, Aman Kapoor wrote: > Hi Ayan, > >

[go-nuts] Re: chidley: XML to Go structs

2017-06-14 Thread singhania . shrink
To install chidley, I did the following: go get github.com/gnewton/chidley This worked. However, issue on chidley -W xml/test1.xml > examples/test/ChildTest1.go -bash: chidley: command not found How do I fix this? Thanks On Thursday, August 28, 2014 at 7:33:27 AM UTC-4, Glen Newton wrote:

Re: [go-nuts] Why *cookie and cookie variables returns the cookie in different format upon printing it to terminal?

2017-06-14 Thread Aman Kapoor
Hi Ayan, Thank you for pointing me to the right code. I saw there how string method is creating the response. I think this is what I needed to see for my question. Thank you. On Wednesday, 14 June 2017 22:28:55 UTC+5:30, Ayan George wrote: > > Hi Aman -- > > When you print *http.Cookie, Go

Re: [go-nuts] Problem with building Go1.4.3 in OpenBSD/386

2017-06-14 Thread Henry
Hi Dave, Thanks for the idea. You are right. They have patches that aren't upstreamed yet. The OpenBSD port builds just fine on my machine, but the official version does not. I have opened up an issue on https://github.com/golang/go/issues/20672 together with a copy of their ports. Hopefully,

Re: [go-nuts] Why *cookie and cookie variables returns the cookie in different format upon printing it to terminal?

2017-06-14 Thread Ayan George
Hi Aman -- When you print *http.Cookie, Go does it's best to print each field knowing that it is a pointer to a struct. This is the format you end up with. But http.Cookie has a String() method associated with it that provides the output that you get when you simply print 'cookie' (without the

[go-nuts] Why *cookie and cookie variables returns the cookie in different format upon printing it to terminal?

2017-06-14 Thread Aman Kapoor
Hi, I was setting up cookies today. Go is my first web development language. And, in my code (https://github.com/amankapoor/basic-authentication-using-cookies), I outputted the cookie to command line because I wanted to see how it looked there. I found that *cookie and cookie are returning

[go-nuts] Passing []byte from golang to char * C.

2017-06-14 Thread Tamás Gulácsi
Both should work. What is your C function? -- 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

Re: [go-nuts] Passing []byte from golang to char * C.

2017-06-14 Thread andrey mirtchovski
can you show us a complete example with a stub C function? in particular the conversion to (*C.char) from unsafe.Pointer([0]) should work. compare the first four bits at that address with the first four bits you're receiving on the C side. they should be identical. e.g.:

Re: [go-nuts] goxpath: An XPath 1.0 parser

2017-06-14 Thread Jim Robinson
Since he was the initial author of this thread you're replying to, it does seem reasonable enough to also raise the question here. :) On Wednesday, June 14, 2017 at 7:25:08 AM UTC-7, Lutz Horn wrote: > > Hi, > > Am 14.06.2017 15:57 schrieb seamus via golang-nuts: > > Yes referring to

Re: [go-nuts] goxpath: An XPath 1.0 parser

2017-06-14 Thread Lutz Horn
Hi, Am 14.06.2017 15:57 schrieb seamus via golang-nuts: Yes referring to https://github.com/ChrisTrenkamp/goxpath ... You would be Chris Trenkamp. Then you will probably get better answers if you open an issue on this GitHub project. The people here on go-nuts did not write this library nor

[go-nuts] Passing []byte from golang to char * C.

2017-06-14 Thread aditi . bhiwaniwala
I have a byte array of image in golang , i have to pass this array to my C function as char* . I did he following , data, err := ioutil.ReadAll(out.Body) str := fmt.Sprintf("%s",data) s:=C.main1(C.CString(str)) s:=C.main1((*C.char)(unsafe.Pointer([0]))) but

Re: [go-nuts] goxpath: An XPath 1.0 parser

2017-06-14 Thread seamus via golang-nuts
Yes referring to https://github.com/ChrisTrenkamp/goxpath YANG is a data modelling language, that may use XML to represent the data stored in a model. Valid relationship between nodes can be expresses as XPATH expressions. These XPATH expression sometimes use current(), for example:

Re: [go-nuts] goxpath: An XPath 1.0 parser

2017-06-14 Thread Lutz Horn
Hi, I've been doing some work on goxpath to use it to evaluate xpath expressions used in YANG. One issue I just hit is the XSLT current() function is used in the YANG files, this fails to evaluate as current() isn't included in the implementation. Did you consider it at all ? * Are you

[go-nuts] goxpath: An XPath 1.0 parser

2017-06-14 Thread seamus via golang-nuts
I've been doing some work on goxpath to use it to evaluate xpath expressions used in YANG. One issue I just hit is the XSLT current() function is used in the YANG files, this fails to evaluate as current() isn't included in the implementation. Did you consider it at all ? -- You received this

[go-nuts] workstealing goroutine scheduling algorithm for real-time applications?

2017-06-14 Thread akashina
Hi I am looking to use the work-stealing algorithm of goroutine scheduling for real-time. I have a model of G struct where i have added a deadline parameter and execution time parameter and modified newproc() to initialize it; I was wondering if anyone has explored realtime scheduling in go and

Re: [go-nuts] Problem with building Go1.4.3 in OpenBSD/386

2017-06-14 Thread Dave Cheney
Can you check to see if they have patches in ports that aren't upstreamed yet. If so, while there is some resistance to keeping the 1.4 branch alive, if it reduces the background noise of the bootstrap tarball rotting, I think that would be beneficial. -- You received this message because you

[go-nuts] [Assembler] How can I call SIMD immediate by FP?

2017-06-14 Thread Zhuo Meng
The SHUFPD opcode needs X1, X2, ib three arguments, but I want to make a Go function like shufpd(x1, x2 interface{}, imm8u uint8) and I hope the asm file like SHUFPD X1, X2, imm+48(FP) but it doesn't work, any suggestion? -- You received this message because you are subscribed to the

Re: [go-nuts] Create methods for structs at runtime

2017-06-14 Thread Lutz Horn
Hi, Given an interface, how can I create a struct instance with the methods of the interface at runtime? What is your usecase for this? What problem are you trying to solve? Lutz -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To