[go-nuts] Re: Distinct types

2017-10-02 Thread Christian Surlykke
Den mandag den 2. oktober 2017 kl. 21.33.04 UTC+2 skrev Dave Cheney: > > Back before aliases defined types used to be called named types, which > permitted the existence of unnamed types. > > map[string]string > > is an unnamed type > > type Dictionary map[string]string > > is a named type, its n

[go-nuts] Re: LiteIDE 32.2 Trojan?

2017-10-02 Thread Fino
I found my LiteIDE keeps open new IE/Firefox , whenever I press some keys. 在 2017年10月3日星期二 UTC+8上午1:56:01,Ben K写道: > > My colleague and I have noticed that windows defender is reporting one of > the DLLs in IliteIDE v32.2 (lib/liteide/plugins/litebuild.dll) contains a > Trojan (Win32/Azden.A!

Re: [go-nuts] Gofmt adds CR 0a to the end of my main.go

2017-10-02 Thread William Josefsson
Hi Ian, my apologies. I meant LF. I read about it and I understand that the unix line endings should be \n LF. Not related to gofmt, but it seems my editor sublime3 (on windows, I tested on linux too) confused me while editing my main.go. I've got "default_line_ending": "unix", However this does

Re: [go-nuts] Memory issues when spawning 1 million go routines that communicate on a channel

2017-10-02 Thread Unni Krishnan
I tried FreeOSMemory, didn't make any difference. On Mon, 2 Oct 2017, 5:26 a.m. Ian Lance Taylor, wrote: > On Sat, Sep 30, 2017 at 9:29 AM, wrote: > > > > From what I understand reading and a few comments from the gopher slack, > > this is because go is not releasing memory back to OS but hol

Re: [go-nuts] internal/poll.runtime_pollWait problem on RHEL with 3.10.0-327.el7.x86_64

2017-10-02 Thread Dan Kortschak
Agreed. I think there is a deep problem, but the deep problem is here rather than in the Go tests. thanks Dan On Mon, 2017-10-02 at 18:16 -0700, Ian Lance Taylor wrote: > 10 minutes is the default timeout, so that's why that run failed. > > 5 minutes, the time shown above, is an extraordinarily

Re: [go-nuts] internal/poll.runtime_pollWait problem on RHEL with 3.10.0-327.el7.x86_64

2017-10-02 Thread Ian Lance Taylor
On Mon, Oct 2, 2017 at 5:51 PM, Dan Kortschak wrote: > > Trying today, the roles of the machines have reversed; the one failing > on Friday passed today and vice versa. The passing test: > > ``` > $ time go test -test.short cmd/go > ok cmd/go 339.070s > > real5m45.804s > user1m38.821

Re: [go-nuts] internal/poll.runtime_pollWait problem on RHEL with 3.10.0-327.el7.x86_64

2017-10-02 Thread Dan Kortschak
Trying today, the roles of the machines have reversed; the one failing on Friday passed today and vice versa. The passing test: ``` $ time go test -test.short cmd/go ok  cmd/go 339.070s real5m45.804s user1m38.821s sys 0m49.390s ``` The version is a lie - there is a change to mal

[go-nuts] Re: Distinct types

2017-10-02 Thread Dave Cheney
Back before aliases defined types used to be called named types, which permitted the existence of unnamed types. map[string]string is an unnamed type type Dictionary map[string]string is a named type, its name is Dictionary And the rules of assignment permitted assignment from or to an unna

[go-nuts] Distinct types

2017-10-02 Thread Christian Surlykke
Forgive me if this has been asked before. I've not been able to find a diskussion about it. A snippet like this type AppleCount uint32 var i uint32 = 7 var ac AppleCount = i will fail to compile with an error like: cannot use i (type uint32) as type AppleCount in assignment OTOH code like

[go-nuts] LiteIDE 32.2 Trojan?

2017-10-02 Thread Ben K
My colleague and I have noticed that windows defender is reporting one of the DLLs in IliteIDE v32.2 (lib/liteide/plugins/litebuild.dll) contains a Trojan (Win32/Azden.A!cl) . Also virustotal reports a couple of engines are detecting as well (https://www.virustotal.com/#/file/aa1fe49e7e5e6c4e4f

Re: [go-nuts] Errors out of syscall

2017-10-02 Thread Chris Hopkins
Thanks, that's really useful. It never occurred to me that you could cast it to a type after the error has been appended - my attempts to print out the type that was being returned didn't show this as an option. I'll have a play. Thanks again On Monday, 2 October 2017 17:20:41 UTC+1, Marvin Re

[go-nuts] Announcing: Skylark in Go

2017-10-02 Thread 'Alan Donovan' via golang-nuts
I'm pleased to announce the launch of Skylark in Go: an interpreter for Skylark, implemented in Go. github.com/google/skylark Skylark is a dialect of Python intended for use as a configuration language. Like Python, it is an untyped dynamic language with high-level data types, first-class

Re: [go-nuts] Gofmt adds CR 0a to the end of my main.go

2017-10-02 Thread Ian Lance Taylor
On Mon, Oct 2, 2017 at 3:36 AM, William Josefsson wrote: > > When I run $ go fmt main.go, I can see that the formatter adds an CR > '0a' character at the end. I verify this before and after with > hexdump. My editor also can detect the trailing line. Somewhat > confusing. > > Is this expected? I t

Re: [go-nuts] Errors out of syscall

2017-10-02 Thread Marvin Renich
* Marvin Renich [171002 11:31]: > * Chris Hopkins [171002 10:52]: > > out, err := os.Create(potential_file_name) > > switch t := err.(type) { > > case *os.PathError: > > switch t.Err { > > case os.ErrNotExist: > > log.Fatal("Invalid filename", potential_file_name) > > case

[go-nuts] Re: Second nested done case in a select statement

2017-10-02 Thread go-question
Thanks again. On Monday, October 2, 2017 at 5:36:41 AM UTC-7, Tamás Gulácsi wrote: > > Yes. > Receiving drom c with (<-c) would wait indefinitely. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

Re: [go-nuts] Errors out of syscall

2017-10-02 Thread Marvin Renich
* Chris Hopkins [171002 10:52]: > out, err := os.Create(potential_file_name) > switch t := err.(type) { > case *os.PathError: > switch t.Err { > case os.ErrNotExist: > log.Fatal("Invalid filename", potential_file_name) > case os.ErrInvalid: > log.Fatal("Invalid argume

[go-nuts] Gofmt adds CR 0a to the end of my main.go

2017-10-02 Thread William Josefsson
Hi, When I run $ go fmt main.go, I can see that the formatter adds an CR '0a' character at the end. I verify this before and after with hexdump. My editor also can detect the trailing line. Somewhat confusing. Is this expected? I tried to search for this but couldn't find any reason to what may c

Re: [go-nuts] Errors out of syscall

2017-10-02 Thread Chris Hopkins
Sorry I was showing a code fragment as the actual code is a bit rubbish! Truncated version at the end, but the point was that it was an error of type *os.PathError. It appears that the os package is creating a new error: https://golang.org/src/os/file_unix.go?s=4493:4559#L170 based upon the retur

Re: [go-nuts] Errors out of syscall

2017-10-02 Thread Jakob Borg
Presumably OP means that the actual type of the error is not exported and cant be type switched upon. However, the syscall errors are typically syscall.Errno and can be inspected for their numeric value, obviating the need to look at the string. It's rather platform specific though at that poin

Re: [go-nuts] Errors out of syscall

2017-10-02 Thread Jan Mercl
On Mon, Oct 2, 2017 at 2:51 PM Chris Hopkins wrote: > Yes, it has dynamic type. That doesn't mean you can't test against it. > I thought the preferred way to to handle errors was for a package to expert the error variables, then you could test for those variables as in the above code. The code s

Re: [go-nuts] Errors out of syscall

2017-10-02 Thread Chris Hopkins
So I guess another way of phrasing this question is, is this post gospel: https://dave.cheney.net/2016/04/27/dont-just-check-errors-handle-them-gracefully If so, is there a plan to backport this into the whole standard library? Regards & Apoligies Chris On Monday, 2 October 2017 13:51:24 UTC+1,

Re: [go-nuts] Errors out of syscall

2017-10-02 Thread Chris Hopkins
Yes, it has dynamic type. That doesn't mean you can't test against it. I thought the preferred way to to handle errors was for a package to expert the error variables, then you could test for those variables as in the above code. For the packages that don't do that you can call Error on the erro

[go-nuts] Re: Second nested done case in a select statement

2017-10-02 Thread Tamás Gulácsi
Yes. Receiving drom c with (<-c) would wait indefinitely. -- 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 optio

Re: [go-nuts] Errors out of syscall

2017-10-02 Thread Jan Mercl
On Mon, Oct 2, 2017 at 2:19 PM Chris Hopkins wrote: I'm not sure I understand: error is an interface and it always has some dynamic type when non-nil. But that type cannot by string b/c string does not implement the error interface. -- -j -- You received this message because you are subscrib

[go-nuts] Errors out of syscall

2017-10-02 Thread Chris Hopkins
Hi, I'm used to doing error handling like the following: out, err := os.Create(potential_file_name) switch t := err.(type) { case *os.PathError: switch t.Err { case os.ErrNotExist: etc... However I came a cropper with an error that I traced to coming out of syscall - specifically

Re: [go-nuts] Go get -f still checking VCS

2017-10-02 Thread Jakob Borg
The documentation for the -f flags says: > The -f flag, valid only when -u is set, forces get -u not to verify that > each package has been checked out from the source control repository > implied by its import path. This can be useful if the source is a local fork > of the original. However, you

[go-nuts] XML unmarshaller doesn't handle whitespace

2017-10-02 Thread Per Persson
Probably it's best to ask here before I try to contact the Go developers. I had a file with space padded numbers (NumberOfPoints=" 266703") and the XML unmarshaller couldn't handle the spaces. Booleans are trimmed , so w

[go-nuts] Released sting 1.0.0

2017-10-02 Thread snmed
Hi all I released my first open source go project: https://bitbucket.org/snmed/sting It's a simple DI library and is used for my own projects. I'm not sure how idomatic go it is, but I primarily started it to learn the go reflection package and capabilities. I'm sure there is still a lot to i

[go-nuts] Re: Go get -f still checking VCS

2017-10-02 Thread alexandre . ferrieux
Bump -- this looks like a very basic misbehavior, the "-f" flag simply ignored... any taker ? On Sunday, October 1, 2017 at 6:16:58 AM UTC+2, alexandre...@gmail.com wrote: > > Hi, > > I'm trying to build quic-go (Go implementation of the QUIC protocol > https://github.com/lucas-clemente/quic-go