Re: [go-nuts] [ANN] Mirror of Go SSA

2016-06-14 Thread Ian Lance Taylor
On Tue, Jun 14, 2016 at 7:07 PM, wrote: > Mirror of the Go compiler SSA library - https://github.com/bjwbell/ssa > The mirror is automatically updated daily. > > Any feedback is welcome. I'm unsure on the licensing requirements for > mirroring. The license requirements in general are in the LIC

[go-nuts] [ANN] Mirror of Go SSA

2016-06-14 Thread bjwbell
Mirror of the Go compiler SSA library - https://github.com/bjwbell/ssa The mirror is automatically updated daily. Any feedback is welcome. I'm unsure on the licensing requirements for mirroring. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group.

[go-nuts] Re: Problem with `go run *.go` in windows CMD - winapi error #123

2016-06-14 Thread as . utf8
How exactly do you propose this be fixed? Windows has a crippled shell that thinks programs should process and interpret their own asterisk characters. This turns into a major inconsistency across windows CLI tools. I dont think Go should tailor itself to badly designed plumbing. -- You recei

Re: [go-nuts] A proposal for generic in go

2016-06-14 Thread Ian Lance Taylor
On Tue, Jun 14, 2016 at 6:04 PM, xingtao zhao wrote: > Here is my proposal for generic in go: > https://docs.google.com/document/d/1nO7D15c2B3eq2kF62C0yUs_UgpkyPL2zHhMAmlq1l98/edit?usp=sharing > > Many parts has not been finished, and just initial thoughts. In the > proposal, I want to keep back c

[go-nuts] A proposal for generic in go

2016-06-14 Thread xingtao zhao
Here is my proposal for generic in go: https://docs.google.com/document/d/1nO7D15c2B3eq2kF62C0yUs_UgpkyPL2zHhMAmlq1l98/edit?usp=sharing Many parts has not been finished, and just initial thoughts. In the proposal, I want to keep back compatibility. And I try to add the orthogonal feature only a

[go-nuts] [Announce] sybil - an append-only column store

2016-06-14 Thread okay zed
Hi golang-nuts! [this is sybil's first public announcement; feedback, discussion, comments or bugs are much appreciated, any and all help welcome!] sybil (v0.0.5) is a free and libre append-only event store that is designed for full table scans and aggregations of raw event records. you can thin

[go-nuts] Re: reading from file that is closed after starting the read

2016-06-14 Thread julio . nemesis
I am having the same trouble with a tty too. I ended up with pthread_kill to signal the specific goroutines blocked in read: https://play.golang.org/p/VZhm2-dX0B The two goroutines share their ids and wait for each other's completion with a signal. I am not sure how safe it is. But it does the

[go-nuts] Hi! I'm happy to announce the very first release of *nexer* 1.0.0b simple and easy to use and extend content based network multiplexer

2016-06-14 Thread Diego Cena
*nexer* is a simple and easy to use and extend content based network multiplexer (or redirector) made with love and golang. Binaries: https://github.com/diegohce/nexer/releases/latest Source : https://github.com/diegohce/nexer

[go-nuts] Re: Problem with `go run *.go` in windows CMD - winapi error #123

2016-06-14 Thread Dave Cheney
I think you're expecting too much from go run. Please see Minix's comments from 2013, go run is just for short throw away examples. For anything more important, structure your code in packages inside GOPATH. -- You received this message because you are subscribed to the Google Groups "golang-

[go-nuts] Question related to how go get works

2016-06-14 Thread Florin Pățan
Hi, I'm trying to understand the reason why does go get download the current arch/os/no build flags (unless specified)? I'm asking this because in the current vendor chat there's a comparison with go get about it and it would be interesting to know this aspect. Finally, how would you see a vendo

Re: [go-nuts] Is there an easy way to check if two named types are identical across packages?

2016-06-14 Thread Wim Lewis
On Jun 14, 2016, at 2:43 PM, Aurélien Bombo wrote: > It's my understanding that the type checker considers named types identical > only if they're represented by the same pointer. > Thus it makes sense for types.Identical and typeutil.Hasher.Hash to return > incoherent results for say, > type a

Re: [go-nuts] cgo problem with #defines

2016-06-14 Thread Ian Lance Taylor
On Tue, Jun 14, 2016 at 3:34 PM, Dragos Harabor wrote: > > Are there any plans to fix it? This seems like a simple case, though I > realize macros can be a lot more complicated. I would certainly like to see it fixed but I'm not aware of anybody working on it. > Unfortunately I cannot write cod

Re: [go-nuts] cgo problem with #defines

2016-06-14 Thread Dragos Harabor
On Tuesday, June 14, 2016 at 3:22:54 PM UTC-7, Ian Lance Taylor wrote: > > On Tue, Jun 14, 2016 at 3:15 PM, Dragos Harabor > wrote: > > Is the following code supposed to work? Not sure whether I'm doing > something > > wrong or cgo just doesn't support this style of #defines. I reduced it >

Re: [go-nuts] cgo problem with #defines

2016-06-14 Thread Ian Lance Taylor
On Tue, Jun 14, 2016 at 3:15 PM, Dragos Harabor wrote: > Is the following code supposed to work? Not sure whether I'm doing something > wrong or cgo just doesn't support this style of #defines. I reduced it down > to a simple test case, but the actual problem I ran into came from some 3rd > party

Re: [go-nuts] Re: Is syscall.Mmap broken? Or am I?

2016-06-14 Thread Dave Mazzoni
You're too kind. Now I don't feel like an idiot. Thanks again. On Tue, Jun 14, 2016 at 6:17 PM, Dave Cheney wrote: > It helps if you've hit the same issue before :) > > On Wed, Jun 15, 2016 at 8:14 AM, Dave Mazzoni wrote: > > Wow. You all are incredible -- your suggestion nailed it. Now I'm >

[go-nuts] [ANN][UPDATE] Livedev: Live reload tool for Go web app

2016-06-14 Thread Sol
I have recently added a few features I thought were worth sharing. - use fsnotify instead of scanning for changes on every request - automatically reload html pages on change - display panic output in the browser with link to the source file and line number https://github.com/qrtz/livedev Tha

[go-nuts] Is there an easy way to check if two named types are identical across packages?

2016-06-14 Thread Aurélien Bombo
It's my understanding that the type checker considers named types identical only if they're represented by the same pointer. Thus it makes sense for types.Identical and typeutil.Hasher.Hash to return incoherent results for say, type a.MyInt int and type b.MyInt int in packages a and b respectivel

[go-nuts] cgo problem with #defines

2016-06-14 Thread Dragos Harabor
Is the following code supposed to work? Not sure whether I'm doing something wrong or cgo just doesn't support this style of #defines. I reduced it down to a simple test case, but the actual problem I ran into came from some 3rd party .h files that unfortunately I have no control over. package

[go-nuts] Re: Problem with `go run *.go` in windows CMD - winapi error #123

2016-06-14 Thread dataf5l
I was also bit in the ass by this, would you guys please fix it? On Wednesday, January 30, 2013 at 11:15:47 AM UTC-5, Dawid Polak wrote: > > Hi. I have problem with run go run command from windows CMD. > > Standard dev command > > go run *.go > generate error > > GetFileAttributesEx *.go: wina

Re: [go-nuts] Re: Is syscall.Mmap broken? Or am I?

2016-06-14 Thread Dave Cheney
It helps if you've hit the same issue before :) On Wed, Jun 15, 2016 at 8:14 AM, Dave Mazzoni wrote: > Wow. You all are incredible -- your suggestion nailed it. Now I'm getting: > > ./peekgo 0x43c0 > mem[0]:0x3020100mem[1]:0x7060504mem[2]:0xb0a0908 > mem[3]:0xf0e0d0c ... > >

Re: [go-nuts] Re: Is syscall.Mmap broken? Or am I?

2016-06-14 Thread Dave Mazzoni
Wow. You all are incredible -- your suggestion nailed it. Now I'm getting: ./peekgo 0x43c0 mem[0]:0x3020100mem[1]:0x7060504mem[2]:0xb0a0908 mem[3]:0xf0e0d0c ... which is PERFECT. Thanks! On Tue, Jun 14, 2016 at 6:05 PM, Ian Lance Taylor wrote: > On Tue, Jun 14, 2016 at 2

Re: [go-nuts] Re: Is syscall.Mmap broken? Or am I?

2016-06-14 Thread Ian Lance Taylor
On Tue, Jun 14, 2016 at 2:47 PM, Dave Mazzoni wrote: > > Thanks for the suggestions. I'm a bit confused though since Mmap returns a > slice of bytes. I print all the bytes as you can see, but only the first > byte at each 32 bit boundary is correct. I don't know casting several of > them together

Re: [go-nuts] Problem of return func of context.WithTimeout

2016-06-14 Thread Ian Lance Taylor
On Tue, Jun 14, 2016 at 2:36 PM, Shirley Shi wrote: > > Another question is will ctx become invalidated once handleRequest finishes? No, it won't. > In fakeUpFunc, I called a method in remote server, and I tried logging the > request in remote server, I never saw any request got logged. So I won

[go-nuts] Re: Is syscall.Mmap broken? Or am I?

2016-06-14 Thread Dave Mazzoni
Thanks for the suggestions. I'm a bit confused though since Mmap returns a slice of bytes. I print all the bytes as you can see, but only the first byte at each 32 bit boundary is correct. I don't know casting several of them together would somehow derive the correct value. On Tuesday, June 14,

Re: [go-nuts] Problem of return func of context.WithTimeout

2016-06-14 Thread Shirley Shi
Thanks for answering my question. Another question is will ctx become invalidated once handleRequest finishes? In fakeUpFunc, I called a method in remote server, and I tried logging the request in remote server, I never saw any request got logged. So I wonder if it is the case that ctx is invalida

Re: [go-nuts] Is syscall.Mmap broken? Or am I?

2016-06-14 Thread Dave Cheney
As Ian said, alignment and the size of the read are crucial. If you aren't reading (or writing) a word, naturally aligned then the mmu won't spot your access to IO area and you'll get garbage data, https://github.com/davecheney/gpio/blob/master/rpi/gpio.go On Wednesday, 15 June 2016 06:40:45 U

Re: [go-nuts] Bitmasks on signed types

2016-06-14 Thread Michael Jones
I have fought this many times. What I almost always do is cast all variables involved as unsigned so that I can express the logical operations as desired. The exception is right shift which must be signed if the expected outcome for signed values is to happen. On Tue, Jun 14, 2016 at 1:08 PM, Dav

Re: [go-nuts] Is syscall.Mmap broken? Or am I?

2016-06-14 Thread Ian Lance Taylor
On Tue, Jun 14, 2016 at 12:17 PM, Dave Mazzoni wrote: > Hello all - I've been having a hard time getting syscall.Mmap to produce the > "right" values. I'm using 1.6.2 and cross-compiling for the ARM/Linux. I'm > trying to read from Arm memory at its device address 0x43c0. > > Here's the scenar

Re: [go-nuts] Bitmasks on signed types

2016-06-14 Thread Dave MacFarlane
You're right. I've already written it the ugly way, but at least it has the benefit of being generalizable to fixed.Int52_12, while there is no int128. Would a patch that adds a Mult receiver function to Int52_12 and Int26_6 be welcome in x/image/math/fixed? I've already worked out the stupid shif

[go-nuts] Is syscall.Mmap broken? Or am I?

2016-06-14 Thread Dave Mazzoni
Hello all - I've been having a hard time getting syscall.Mmap to produce the "right" values. I'm using 1.6.2 and cross-compiling for the ARM/Linux. I'm trying to read from Arm memory at its device address 0x43c0. Here's the scenario: I 'poke' values into memory using the C based arm/linux

Re: [go-nuts] Bitmasks on signed types

2016-06-14 Thread Matt Harden
Consider coercing them to int64, multiply, then shift and coerce back to Int26_6. I suspect that would be faster than splitting with shifts and ANDs, two int32 multiplies, shift and add. On Tue, Jun 14, 2016, 11:42 Dave MacFarlane wrote: > I'm not actually trying to do x & -1, that would be poin

Re: [go-nuts] Bitmasks on signed types

2016-06-14 Thread Dave MacFarlane
I'm not actually trying to do x & -1, that would be pointless, as you say. It was just the easiest way to demonstrate the behaviour that I didn't understand in a minimal way. I understand the problem now--I was thinking of 0x as a prefix representing a bitmask when used as a constant with a bitwise

Re: [go-nuts] Bitmasks on signed types

2016-06-14 Thread Ian Lance Taylor
On Tue, Jun 14, 2016 at 10:44 AM, Dave MacFarlane wrote: > What I'm not understanding is why that's not the case in this example. It's > a 32 bit bitwise operation on a 32 bit signed type. Shouldn't 0x be > coerced to a value of -1? Why don't you just write -1? I don't actually understa

Re: [go-nuts] Bitmasks on signed types

2016-06-14 Thread Rob Pike
Please read blog.golang.org/constants. -rob On Tue, Jun 14, 2016 at 10:47 AM, Jan Mercl <0xj...@gmail.com> wrote: > The untyped integer constant 0x represents a positive number not > representable by any int32 value. > > > On Tue, Jun 14, 2016, 19:45 Dave MacFarlane wrote: > >> What I'

Re: [go-nuts] Bitmasks on signed types

2016-06-14 Thread Jan Mercl
The untyped integer constant 0x represents a positive number not representable by any int32 value. On Tue, Jun 14, 2016, 19:45 Dave MacFarlane wrote: > What I'm not understanding is why that's not the case in this example. > It's a 32 bit bitwise operation on a 32 bit signed type. Shoul

Re: [go-nuts] Bitmasks on signed types

2016-06-14 Thread Dave MacFarlane
What I'm not understanding is why that's not the case in this example. It's a 32 bit bitwise operation on a 32 bit signed type. Shouldn't 0x be coerced to a value of -1? On Tue, Jun 14, 2016 at 1:23 PM, Jan Mercl <0xj...@gmail.com> wrote: > All binary operators, except shifts, require id

Re: [go-nuts] How to properly get basename under DOS?

2016-06-14 Thread Konstantin Khomoutov
On Tue, 14 Jun 2016 09:55:25 -0700 (PDT) Tong Sun wrote: [...] > However, I just found out that it is *not working under DOS* > -- https://play.golang.org/p/kfr0N50JWc [...] But you mean Windows command prompt, not DOS, do you? I was under the impression someone asked here whether it would be

Re: [go-nuts] Bitmasks on signed types

2016-06-14 Thread Jan Mercl
All binary operators, except shifts, require identical left and right types. Untyped values will be coerced to the type of the other side, if representable as such after the conversion. That's not the case in this example. On Tue, Jun 14, 2016, 19:16 Dave MacFarlane wrote: > Is this supposed to

Re: [go-nuts] How to properly get basename under DOS?

2016-06-14 Thread Tong Sun
Ops, I'll try under DOS... On Tuesday, June 14, 2016 at 1:11:44 PM UTC-4, Tong Sun wrote: > > Like this? -- https://play.golang.org/p/jhK-vmmmdH > > package main > > > import ( > "fmt" > "path/filepath" > ) > > > func main() { > fmt.Println(filepath.Base("/a/b.c")) > fmt.Println(filepath.Base(

[go-nuts] Bitmasks on signed types

2016-06-14 Thread Dave MacFarlane
Is this supposed to be legal in Go: var x int32 = 3 fmt.Printf("%d", x & 0x)? The language spec just says the bitwise operator "applies to integers only" and "yields a result of the same type as the first operand" that I can see, but it's giving me a compiler error: ./main.go:10: consta

Re: [go-nuts] How to properly get basename under DOS?

2016-06-14 Thread Tong Sun
Like this? -- https://play.golang.org/p/jhK-vmmmdH package main import ( "fmt" "path/filepath" ) func main() { fmt.Println(filepath.Base("/a/b.c")) fmt.Println(filepath.Base(`C:\Program Files\Microsoft Visual Studio 9\Common7\IDE\devenv.exe`)) } The output is still exactly the same as b

RE: [go-nuts] How to properly get basename under DOS?

2016-06-14 Thread John Souvestre
> Package path is for *nix paths only. import "path/filepath" instead. When should path be used? Or should it be deprecated in favor of path/filepath? John John Souvestre - New Orleans LA From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of Jan Mercl

Re: [go-nuts] How to properly get basename under DOS?

2016-06-14 Thread Ian Lance Taylor
On Tue, Jun 14, 2016 at 10:00 AM, Jan Mercl <0xj...@gmail.com> wrote: > Package path is for *nix paths only. import "path/filepath" instead. I agree that path/filepath is what you want, but I would say it slightly differently. path is for what you find inside URLs, path/filepath is for paths in t

[go-nuts] Re: Loading X509 Key Pair with invalid Certificate

2016-06-14 Thread Chris Johnson
Figured this out and wanted to reply in case anyone else hits it. Apparently the latest Ubuntu images on DockerHub (14.04.04) do not have the latest cert files baked into them. https://github.com/docker/docker/issues/5157 I just added the following to the Dockerfile that builds this container:

[go-nuts] [ANN] jsonmon 2.0.11

2016-06-14 Thread Vasily Korytov
jsonmon is a simple but powerful monitoring and alerting system. It has only two types of checks: shell and Web. More details at https://github.com/chillum/jsonmon/wiki Today the version 2.0.11 is released, it is a bug fix for the previous optimization release. Versions prior to 2.0.9 were pro

Re: [go-nuts] How to properly get basename under DOS?

2016-06-14 Thread Jan Mercl
Package path is for *nix paths only. import "path/filepath" instead. On Tue, Jun 14, 2016, 18:55 Tong Sun wrote: > I thought to get basename, we should use the official *path.Base* -- > https://golang.org/pkg/path/#Base > > However, I just found out that it is *not working under DOS* -- > https:

[go-nuts] Re: Save to store encryption key in Go executable?

2016-06-14 Thread Evan Digby
Unfortunately there's a reason why password managers still require a passphrase. It's simply not secure to store the key anywhere near the secure files. I'm not saying password managers are perfect--they have their own security issues--but it seems that you're attempting to closely mimic that

[go-nuts] How to properly get basename under DOS?

2016-06-14 Thread Tong Sun
I thought to get basename, we should use the official *path.Base* -- https://golang.org/pkg/path/#Base However, I just found out that it is *not working under DOS* -- https://play.golang.org/p/kfr0N50JWc package main import ( "fmt" "path" ) func main() { fmt.Println(path.Base("/a/b.c"))

[go-nuts] Is it possible to upload golang application to Mac App store?

2016-06-14 Thread liudan king
I developed an application that displays a icon in status bar to show network speed. I have packaged it to a standard mac app package (ns.app and ns.dmg) using command *codesign* and *appdmg.* The problem is that, when I try to upload it to app store using Application Loader, the loader can't re

[go-nuts] Re: [ANN] primegen.go: Sieve of Atkin prime number generator

2016-06-14 Thread alb . donizetti
> Current versions of golang are not as fast as GCC C/C++ optimized code by at least a factor of two This is, in general, not true at all: I've written numeric code as fast as C code compiled by GCC -O3 Il giorno martedì 14 giugno 2016 14:31:18 UTC+2, gordo...@gmail.com ha scritto: > > That's

[go-nuts] [ANN] primegen.go: Sieve of Atkin prime number generator

2016-06-14 Thread gordonbgood
That's interesting but your time or 0.7 seconds on your specified machine isn't very informative: you should at least specify how long the original version of primegen (which is not multithreaded) takes, which we assume as about 0.7 seconds, and also how long your golang version takes without mu