Re: [go-nuts] unix.Poll weirdness

2016-09-15 Thread Dan Kortschak
Thanks for the very clear explanation, Ian. I figured there was something like that. It turns out I was using a fifo badly (I was trying to model a sysfs attribute - clearly incorrectly as I now find out that poll should wait on POLLPRI for sysfs attributes). The original problem is now solved. O

[go-nuts] Re: Is it possible to serve a directory without indexing the contents?

2016-09-15 Thread tobyjaguar
Rodrigo, I may need a bit more help with your example. Can you get me past the Open function, when playing with the example it seems to get stuck here: func (fs filesOnlyFS) Open(name string) (http.File, error) { f, err := fs.Open(name) Is this a recursive call?..doesn't seem to get past this wh

Re: [go-nuts] unix.Poll weirdness

2016-09-15 Thread Ian Lance Taylor
On Thu, Sep 15, 2016 at 6:41 PM, Dan Kortschak wrote: > I am in the process of adding sysfs polling support for a physical > device and I'm using a small Go program > (https://play.golang.org/p/5v8DsGv6Dk) to help test whether what I'm > doing is working (it's not yet). > > In doing this, I've fou

[go-nuts] unix.Poll weirdness

2016-09-15 Thread Dan Kortschak
I am in the process of adding sysfs polling support for a physical device and I'm using a small Go program (https://play.golang.org/p/5v8DsGv6Dk) to help test whether what I'm doing is working (it's not yet). In doing this, I've found somethings that I don't understand with the golang.org/x/sys/un

Re: [go-nuts] Re: Best practices for upgrading go with existing GOPATH?

2016-09-15 Thread Tom Elliott
Aha, now I understand. I managed to reproduce the problem and the failure was occurring while running go vet after the build target (which runs go build on all our packages). Switching to go install to build the packages cleared the problem right up. On Thu, 15 Sep 2016 at 20:19 Dave Cheney wrote

[go-nuts] Re: Best practices for upgrading go with existing GOPATH?

2016-09-15 Thread Dave Cheney
I don't think it's about the installation of the tools. The problem you've described sounds like you have tools that use the compiled form of the package, but your development process has not embraced go install so what you go build the later test is not the same thing. -- You received this m

Re: [go-nuts] go get creating strange git messages in bash. Any ideas what causes this ?

2016-09-15 Thread James Bardin
On Thu, Sep 15, 2016 at 5:53 PM, Joe Blue wrote: > thanks James > > You lost me here. > Where's here? O can try to provide more detail if you let me know what you're not following. If you go into each repo that's not working and checkout master, "go get -u" will work again. > go get always pul

[go-nuts] Re: Best practices for upgrading go with existing GOPATH?

2016-09-15 Thread Tom Elliott
Thanks for the clarification and the advice. Seems that what we need to do is make sure that these key tools are installed from source in the makefile, or provide a script that installs them as a post-go-upgrade step in our instructions. Will experiment with those to see which works best for us

Re: [go-nuts] go get creating strange git messages in bash. Any ideas what causes this ?

2016-09-15 Thread Joe Blue
thanks James You lost me here. go get always pulls from master though ? On Thu, Sep 15, 2016 at 1:25 PM James Bardin wrote: > You have a few repos that aren't on a branch, so git can't pull and fast > forward. You can checkout master in those repos, or delete them altogether > and the next `

Re: [go-nuts] Is it possible to serve a directory without indexing the contents?

2016-09-15 Thread Rodrigo Kochenburger
http.FileServer takes a FileSystem implementation, http.Dir will basically allow accessing any dir/file that's why you get the index for directories. You can create a custom FileSystem implementation: https://play.golang.org/p/BcMLX2NWW7 On Thu, Sep 15, 2016 at 1:40 PM tobyjaguar wrote: > Is po

[go-nuts] Re: Best practices for upgrading go with existing GOPATH?

2016-09-15 Thread Dave Cheney
ok, that sounds like a different problem. Some tools use the cached (.a file in the pkg/ directory) version others use the src directly. If you don't install, the tools that use the .a version will be out of date (at best) or fail (at worse). Really, you want to use go install, just trust me on

[go-nuts] Is it possible to serve a directory without indexing the contents?

2016-09-15 Thread tobyjaguar
Is possible to serve a directory, http.FileServer(http.Dir(".")), without listing the directory contents of that directory by navigating one folder above it in the browser? http.Handle("/img/", http.FileServer(http.Dir("static"))) https://groups.google.com/d/optout.

[go-nuts] Re: Best practices for upgrading go with existing GOPATH?

2016-09-15 Thread Tom Elliott
Thanks for the quick response :) Great to hear that the go tool is intended to catch this. The problem was typically seen when running our default make target, which uses build for the build itself, but has some sanity checking and code generation steps first, with tools like glock, errcheck an

Re: [go-nuts] Base58check to decimal

2016-09-15 Thread Donovan Hide
Here's some code from the example that verifies your decimal value from your input address: https://gist.github.com/donovanhide/7fc3ca5170e8080c9eddda4014394ce0 On 15 September 2016 at 17:48, Donovan Hide wrote: > Yep, read the docs: > > https://godoc.org/github.com/btcsuite/btcutil/base58#Chec

[go-nuts] [ANN] SQLBoiler v2.0.0 - Generate an ORM

2016-09-15 Thread Patrick O'Brien
For anyone unfamiliar with SQLBoiler, SQLBoiler is an ORM generator that uses code generation to gen a fully functioning ORM tailored specifically to your schema. We weren't interested in the reflection-heavy code-first approaches out there, so we decided to have a crack at a database-first cod

Re: [go-nuts] Base58check to decimal

2016-09-15 Thread Donovan Hide
Yep, read the docs: https://godoc.org/github.com/btcsuite/btcutil/base58#CheckDecode The "check" means run SHA256 twice over the previous payload bytes and use the first 4 bytes of the result as the checksum. On 15 September 2016 at 13:11, Nosferatu fist wrote: > No base58 but base58check > >

Re: [go-nuts] Multiple-reader single-writer map access - is this lockless workaround safe?

2016-09-15 Thread Ian Lance Taylor
On Thu, Sep 15, 2016 at 8:47 AM, sqweek E. wrote: > > Thanks everyone for helping me learn! If you'll humour me a moment longer, > I'm curious about the atomic.Value approach. If you have a single writer: > > newMap := make(map[int]int) > newMap[4] = 2 > newMap[9] = 3 > x.myMap.Store(newMap) //x.m

[go-nuts] Re: Initialize a nested autogenerated structure

2016-09-15 Thread sqweek E.
Once you have the JSON encoded data in a byte slice, pass those bytes into json.Unmarshal along with a reference to a variable of type AutoGenerated (or whatever you decide to rename it to). ie: import "encoding/json" ... var bytes []byte var data AutoGenerated bytes = loadJSONFromDB(

[go-nuts] Re: unmarshaling json to byte type

2016-09-15 Thread Jakub Labath
While you can use the solution suggested by Viktor. I do wonder what exactly is the point of the byte type? I mean byte is just uint8 just like it says above. So really if you want number between 0 and 255 you can just send along the number. This is gonna be more readable than some text encoding

Re: [go-nuts] Re: Http Response Body parsing

2016-09-15 Thread Shawn Milochik
Read the request.Body, close the request.Body, use the bytes read from request.Body in json.Unmarshal. -- 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-nut

Re: [go-nuts] Multiple-reader single-writer map access - is this lockless workaround safe?

2016-09-15 Thread sqweek E.
On Wednesday, September 14, 2016 at 2:58:24 AM UTC+8, Henrik Johansson wrote: > > I think this will be an interesting read especially if you come from Java. > > https://shipilev.net/blog/2016/close-encounters-of-jmm-kind/ > There were some surprises in there! With a bit more perspective I can se

[go-nuts] Re: Http Response Body parsing

2016-09-15 Thread rahul . sagore
Anybody knows about parsing data which is coming in somewhat json format? string/int is fine. What will be the best way to parse json response. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving ema

[go-nuts] text/html template extend not override

2016-09-15 Thread MinervaData
I need to extend an existing template and add to what already rendered into it, I have used {{block}} but it overrides the existing templates. Master footer: {{define "footer"}} {{block "footerExtra" . }} {{end}} {{end}} App1: {{block "footerExtra"}} app1 {{end}} App2: {{block "f

Re: [go-nuts] Base58check to decimal

2016-09-15 Thread Nosferatu fist
No base58 but base58check -- 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.

[go-nuts] go get creating strange git messages in bash. Any ideas what causes this ?

2016-09-15 Thread James Bardin
You have a few repos that aren't on a branch, so git can't pull and fast forward. You can checkout master in those repos, or delete them altogether and the next `go get` will fetch the current master branch. -- You received this message because you are subscribed to the Google Groups "golang-

Re: [go-nuts] reading long text without newline from stdin

2016-09-15 Thread vendelin8
On Friday, 9 September 2016 21:51:05 UTC+2, Ian Lance Taylor wrote: > > On Fri, Sep 9, 2016 at 12:36 PM, > > wrote: > > > > On Friday, 9 September 2016 18:45:24 UTC+2, Ian Lance Taylor wrote: > >> > >> On Fri, Sep 9, 2016 at 7:22 AM, wrote: > >> > > >> > I was trying to read a longer text

Re: [go-nuts] Base58check to decimal

2016-09-15 Thread Donovan Hide
This package should help you out: https://github.com/btcsuite/btcutil/tree/master/base58 -- 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-nuts] go get creating strange git messages in bash. Any ideas what causes this ?

2016-09-15 Thread Joe Blue
hey all, Does anyone know why "go get" causes the follow weird git messages ? This does NOT happen with al git repos i have found. a simple example: x-MacBook-Pro:pkg apple$ go get github.com/pkg/sftp x-MacBook-Pro:pkg apple$ go get -u -v github.com/pkg/sftp github.com/pkg/sftp (d

[go-nuts] Re: Base58check to decimal

2016-09-15 Thread Egon
Write a for loop :) https://play.golang.org/p/OZvqcWEOIc Also are you sure that the decimal number is correct... i.e. I got a different result and http://lenschulwitz.com/base58 gives the same result. + Egon On Thursday, 15 September 2016 11:26:11 UTC+3, Nosferatu fist wrote: > > First Hello a

[go-nuts] Base58check to decimal

2016-09-15 Thread Nosferatu fist
First Hello and thank you for any help you can give me . here I have traveled google but I have not found my happiness . I would like to convert decimal number BASE58Check in my research but give nothing example: bitcoin address : 1HZwkjkeaoZfTSaJxDw6aKkxp45agDiEzN In decimal : 1037542844944

[go-nuts] Initialize a nested autogenerated structure

2016-09-15 Thread Jens Ramhorst
Hello, I need to create the following JSON-File: [{ "key": "Series 1", "values": [ [ 105167520, 0.44227126150934 ], [ 105435360, 7.2481659343222 ],

[go-nuts] Re: unmarshaling json to byte type

2016-09-15 Thread Viktor Kojouharov
It would probably be pretty easy if you implement the json.Unmarshaler interface on the byte type: https://play.golang.org/p/hzGalLA2yA On Wednesday, September 14, 2016 at 6:06:41 PM UTC+3, Luke wrote: > > Hi, > > i have something like: https://play.golang.org/p/j5WhDMUTI- > > type A struct { >