[go-nuts] Imp.ListenPacket fail for IPv6 address

2019-10-09 Thread 'Serguei Bezverkhi (sbezverk)' via golang-nuts
Hello, Here is the part of code where I attempt to listen for icmp packet in a namespace. The same code is used for IPv4 and IPv6, only proto and scr are differ depending on ipv4 or ipv6 mode. For IPv4 address code work as expected but for IPv6 ListenPacket fails. org, err := ne

Re: [go-nuts] rebuild & reinstall pkg/tool/.../link

2019-10-09 Thread Ian Lance Taylor
On Wed, Oct 9, 2019 at 3:11 AM Liam wrote: > > I have the current 1.12 release from a Linux distro, installed in /usr/lib/go. > > If I patch the linker source, how would I rebuild and reinstall > pkg/tool/.../link ? It may depend on just what the Linux distro has done. The basic command would b

[go-nuts] Re: net: conn.WriteToUDP([]byte("not ok"), addr)

2019-10-09 Thread Gert
thx Andrey Mirtchovski err was `write udp 127.0.0.1:59864->127.0.0.1:5127: use of WriteTo with pre-connected connection` -- 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

[go-nuts] net: conn.WriteToUDP([]byte("not ok"), addr)

2019-10-09 Thread Gert
Hi, I am trying to figure out why what's going on? conn.Write([]byte("ok")) https://play.golang.org/p/8Fq1XyYTFs1 vs conn.WriteToUDP([]byte("not ok"), addr) https://play.golang.org/p/NkUKn-Oz8XA I assumed it was unintended behavior and opened a issue at https://github.com/golang/go/issues/34

Re: [go-nuts] Interface method return other interface?

2019-10-09 Thread Robert Engels
Ugh. Every time I see that I cringe > On Oct 9, 2019, at 7:58 PM, burak serdar wrote: > > On Wed, Oct 9, 2019 at 5:48 PM 'Axel Wagner' via golang-nuts > wrote: >> >> There's loads of precedence in the stdlib: >> >> https://godoc.org/net/http/#FileSystem.Open >> https://godoc.org/net/http

Re: [go-nuts] Interface method return other interface?

2019-10-09 Thread burak serdar
On Wed, Oct 9, 2019 at 5:48 PM 'Axel Wagner' via golang-nuts wrote: > > There's loads of precedence in the stdlib: > > https://godoc.org/net/http/#FileSystem.Open > https://godoc.org/net/http#File.Stat > https://godoc.org/net#Conn.LocalAddr > https://godoc.org/database/sql/driver/#Driver.Open > ht

Re: [go-nuts] Interface method return other interface?

2019-10-09 Thread 'Axel Wagner' via golang-nuts
There's loads of precedence in the stdlib: https://godoc.org/net/http/#FileSystem.Open https://godoc.org/net/http#File.Stat https://godoc.org/net#Conn.LocalAddr https://godoc.org/database/sql/driver/#Driver.Open https://godoc.org/image#Image.ColorModel https://godoc.org/reflect/#Type.Elem And don'

[go-nuts] Re: Problems with windows installation v1.31.1

2019-10-09 Thread Longeri Carlos
Thanks, the windows installer does install the icon on the program list, maybe it should be fix. El miércoles, 9 de octubre de 2019, 14:15:55 (UTC-3), peterGo escribió: > > Longeri Carlos, > > Go 1.13 Release Notes > https://golang.org/doc/go1.13 > > godoc and go doc > https://golang.org/doc/go1

[go-nuts] Re: Problems with windows installation v1.31.1

2019-10-09 Thread peterGo
Longeri Carlos, Go 1.13 Release Notes https://golang.org/doc/go1.13 godoc and go doc https://golang.org/doc/go1.13#godoc The godoc webserver is no longer included in the main binary distribution. To run the godoc webserver locally, manually install it first: go get golang.org/x/tools/cmd/godo

Re: [go-nuts] Problems with windows installation v1.31.1

2019-10-09 Thread Dimas Prawira
Go v1.12.10 still has godoc in the installer package, so if you want it maybe you can choose previous version. Best Regards On Wed, Oct 9, 2019, 11:46 PM Longeri Carlos wrote: > Hi, > I'm new to go. Just installed Go on a windows10 machine, v1.31.1. > > Somehow I don't have godoc.exe in the bin

[go-nuts] Problems with windows installation v1.31.1

2019-10-09 Thread Longeri Carlos
Hi, I'm new to go. Just installed Go on a windows10 machine, v1.31.1. Somehow I don't have godoc.exe in the bin file. i also downloaded the zip installation file and it also doesn't have it. Please help. -- You received this message because you are subscribed to the Google Groups "golang-nuts

Re: [go-nuts] json time format discrepancy

2019-10-09 Thread Andrey Tcherepanov
Thanks Anderson, I think I got a classical PEBKAC problem here, so all is good now. On Wednesday, October 9, 2019 at 8:25:05 AM UTC-6, Anderson Queiroz wrote: > > Indeed looks odd, but as Jakob showed, it looks fine. I was playing > directly with the marshal/unmarshall and I didn't fine any prob

Re: [go-nuts] json time format discrepancy

2019-10-09 Thread Andrey Tcherepanov
Thanks Jakob. I am shamefully have to concur that I indeed messed up. Now I need to find where did I do it though :) Still curious - how RFC3339 works with parsing nanoseconds past decimal point? Andrey On Tuesday, October 8, 2019 at 11:29:29 PM UTC-6, Jakob Borg wrote: > > On 8 Oct 2019, at 1

Re: [go-nuts] How to print arrays with commas and brackets

2019-10-09 Thread Lutz Horn
I tried to print array with brackets and commas in golang. I want to get array like this. ["record1", "record2". "record3"] Encode the array to JSON: ``` package main import ( "encoding/json" "fmt" "log" "os" ) func main() { strings := [3]string{"foo",

[go-nuts] How to print arrays with commas and brackets

2019-10-09 Thread Nalin Pushpakumara
Hi, I tried to print array with brackets and commas in golang. I want to get array like this. ["record1", "record2". "record3"] Does anyone know how to do it? Thank you -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this g

Re: [go-nuts] json time format discrepancy

2019-10-09 Thread Anderson Queiroz
Indeed looks odd, but as Jakob showed, it looks fine. I was playing directly with the marshal/unmarshall and I didn't fine any problem either. My playground: https://play.golang.org/p/LLmQqxLKfME On Wednesday, 9 October 2019 07:29:29 UTC+2, Jakob Borg wrote: > > On 8 Oct 2019, at 19:27, Andrey Tc

[go-nuts] About package lxn/walk

2019-10-09 Thread 洪嘉鴻
Hello everyone: I'm a beginner for golang with Win10. Now I'm trying to write an user interface. The version of the golang which I am using is 1.12.9. Here are some problems that I'm encountering: 1. How to append text with a new line? 2. How to output variables as the "fmt.Println" funct

[go-nuts] Re: Interface method return other interface?

2019-10-09 Thread Jake Montgomery
It is a generally accepted best practice in go to "accept interfaces and return structs". Just google "golang accept interfaces return structs". However, there are absolutely times when it is ok, or even necessary, to return an interface. They key to to read some of the articles about the pract

Re: [go-nuts] rebuild & reinstall pkg/tool/.../link

2019-10-09 Thread Liam Breck
On Wed, Oct 9, 2019, 3:17 AM Jan Mercl <0xj...@gmail.com> wrote: > On Wed, Oct 9, 2019 at 12:10 PM Liam wrote: > > > > I have the current 1.12 release from a Linux distro, installed in > /usr/lib/go. > > > > If I patch the linker source, how would I rebuild and reinstall > pkg/tool/.../link ? > >

Re: [go-nuts] rebuild & reinstall pkg/tool/.../link

2019-10-09 Thread Jan Mercl
On Wed, Oct 9, 2019 at 12:10 PM Liam wrote: > > I have the current 1.12 release from a Linux distro, installed in /usr/lib/go. > > If I patch the linker source, how would I rebuild and reinstall > pkg/tool/.../link ? I think there are two options: - Learn how to make the distro's package from s

[go-nuts] rebuild & reinstall pkg/tool/.../link

2019-10-09 Thread Liam
I have the current 1.12 release from a Linux distro, installed in /usr/lib/go. If I patch the linker source, how would I rebuild and reinstall pkg/tool/.../link ? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group a

[go-nuts] Re: [ANN] Go Server Pages

2019-10-09 Thread Space A.
Interesting, but you know what, when I read that web server name is Apache* in 2019, I don't read any further. On Tuesday, October 8, 2019 at 8:16:09 PM UTC+3, Scott Pakin wrote: > > I'm excited to announce the initial release of > > Go Server Pages > > Go Server Pages is an Apache module that

Re: [go-nuts] Interface method return other interface?

2019-10-09 Thread Mohamed Yousif
I always find accept interface and return struct to be very useful. It makes the code more cleaner. On Wed, 9 Oct 2019 at 9:40 AM, Martin Palma wrote: > I'm wondering If it is ok (or good Go code) if an interface method returns > an other interface? Here an example: > > type Querier interface

[go-nuts] Interface method return other interface?

2019-10-09 Thread Martin Palma
I'm wondering If it is ok (or good Go code) if an interface method returns an other interface? Here an example: type Querier interface { Query() string } type Decoder interface { DecodeAndValidate() Querier } -- You received this message because you are subscribed to the Google Groups "gol