Re: [go-nuts] Brook v20210214 Released – cross-platform strong encryption, undetectable proxy. Open Source via GPLv3

2021-02-26 Thread txthinking com
The document is markdown and it use js to parse to html. If you want txt document, see here https://github.com/txthinking/brook/tree/master/docs On Sat, Feb 27, 2021 at 1:05 AM Wojciech S. Czarnecki wrote: > Dnia 2021-02-25, o godz. 19:50:24 > txthinking com napisał(a): > > > > Document: https

[go-nuts] Suppress Warning in VSCode

2021-02-26 Thread Kaveh Shahbazian
This is a simple snippet for writing BDD-style tests in go. When the package support is imported in the tests for another package, vscode shows a warning composite literal uses unkeyed fields. How to suppress this message? What w

Re: [go-nuts] Possible issue in docs for Listen and ListenPacket

2021-02-26 Thread Ian Lance Taylor
On Fri, Feb 26, 2021 at 12:07 PM John Dreystadt wrote: > > The documentation for func (*ListenConfig) Listen ends with the line "See > func Listen for a description of the network and address parameters". The > next function called ListenPacket has the same line with the name changed to > List

[go-nuts] Possible issue in docs for Listen and ListenPacket

2021-02-26 Thread John Dreystadt
The documentation for func (*ListenConfig) Listen ends with the line "See func Listen for a description of the network and address parameters". The next function called ListenPacket has the same line with the name changed to ListenPacket. I think that these should actually say "See func Dial f

Re: [go-nuts] When using fmt.Print to print a reflect.Value v, v.Elem() is printed instead. Why?

2021-02-26 Thread tapi...@gmail.com
Thanks for the info. The info does verify that reflect.Values are specially handled in fmt.Print, and it also clearly sates String() method of the argument reflect.Values are not called in fmt.Print: The fmt package treats Values specially. It does not call their String method implicitl

Re: [go-nuts] Brook v20210214 Released – cross-platform strong encryption, undetectable proxy. Open Source via GPLv3

2021-02-26 Thread Wojciech S. Czarnecki
Dnia 2021-02-25, o godz. 19:50:24 txthinking com napisał(a): > Document: https://txthinking.github.io/brook/ There is NO document there, the less txt document. This url wants to load a javascript app. Good telltale about "security". -- Wojciech S. Czarnecki << ^oo^ >> OHIR-RIPE -- You rec

Re: [go-nuts] Incompatibility of reflection libraries (reflect versus go-reflect), on json-iterator (Go 1.15.8)

2021-02-26 Thread Yan Titarenko
On Fri, Feb 26, 2021 at 5:49 PM Ian Lance Taylor wrote: > On Fri, Feb 26, 2021 at 7:20 AM Than McIntosh wrote: > > > > > > My sense is that developers are using packages like reflect2 for > performance reasons, very often to try to improve JSON > marshalling/unmarshalling speed. These packages t

Re: [go-nuts] Incompatibility of reflection libraries (reflect versus go-reflect), on json-iterator (Go 1.15.8)

2021-02-26 Thread Ian Lance Taylor
On Fri, Feb 26, 2021 at 7:20 AM Than McIntosh wrote: > > > My sense is that developers are using packages like reflect2 for performance > reasons, very often to try to improve JSON marshalling/unmarshalling speed. > These packages tend to bypass the Go type system using "unsafe" in order to > p

Re: [go-nuts] Need help/tips on golang compiler souce code reading

2021-02-26 Thread Ian Lance Taylor
On Fri, Feb 26, 2021 at 12:29 AM messi...@gmail.com wrote: > > I'm reading the source code of version 1.15.6, but I found the code base > structure on master branch is very different, some changes are refactors as > you mentioned above(typechecker), and some are for new features(e.g. > generics

Re: [go-nuts] Incompatibility of reflection libraries (reflect versus go-reflect), on json-iterator (Go 1.15.8)

2021-02-26 Thread 'Than McIntosh' via golang-nuts
My sense is that developers are using packages like reflect2 for performance reasons, very often to try to improve JSON marshalling/unmarshalling speed. These packages tend to bypass the Go type system using "unsafe" in order to provide reflect-like operations without the overhead (e.g. allocation)

Re: [go-nuts] When using fmt.Print to print a reflect.Value v, v.Elem() is printed instead. Why?

2021-02-26 Thread Charles Banning
Yes. You need to understand how "fmt" handles types with String() methods. From the docs: func (Value) Elem func (v Value ) Elem() Value Elem r

Re: [go-nuts] Incompatibility of reflection libraries (reflect versus go-reflect), on json-iterator (Go 1.15.8)

2021-02-26 Thread Ian Lance Taylor
On Fri, Feb 26, 2021 at 6:11 AM Yan Titarenko wrote: > > CC'ing to committers. > > Ian, > please provide some advise. I'm sorry, I don't have anything useful to add beyond what I've already said. I don't know why people are using the reflect2 package. The package does not support gccgo/GoLLVM.

Re: [go-nuts] Incompatibility of reflection libraries (reflect versus go-reflect), on json-iterator (Go 1.15.8)

2021-02-26 Thread Robert Engels
Maybe direct your inquiries to the developer if go-reflect? > On Feb 26, 2021, at 8:11 AM, Yan Titarenko > wrote: > >  > CC'ing to committers. > > Ian, > please provide some advise. > > Thanks in advance > >> On Wed, Feb 24, 2021 at 2:00 PM Yan Titarenko >> wrote: >> Hi. >> >> Since ther

Re: [go-nuts] Incompatibility of reflection libraries (reflect versus go-reflect), on json-iterator (Go 1.15.8)

2021-02-26 Thread Yan Titarenko
CC'ing to committers. Ian, please provide some advise. Thanks in advance On Wed, Feb 24, 2021 at 2:00 PM Yan Titarenko wrote: > Hi. > > Since there where no comments on > https://github.com/json-iterator/go/issues/501 - I decided that an open > discussion (not necessarily on behalf of this pro

Re: [go-nuts] still struggling to understand modules

2021-02-26 Thread Brian Candler
On Friday, 26 February 2021 at 12:27:09 UTC rob wrote: > When I try "go mod init" in my /home/rob/go/src, I get an error > > go: cannot determine module path for source directory /home/rob/go/src > (outside GOPATH, module path must be specified) > > What it means is, you must give a name (impor

Re: [go-nuts] When using fmt.Print to print a reflect.Value v, v.Elem() is printed instead. Why?

2021-02-26 Thread clba...@gmail.com
Yes. You have to understand how "fmt.Print," etc., handle types with String() methods. From the docs: package fmt - 5. If an operand implements method String() string, that method will be invoked to convert the object to a string, which will then be formatted as required by the verb (if any

Re: [go-nuts] still struggling to understand modules

2021-02-26 Thread rob
Nope.  I didn't solve it.  The code compiles because of GO111MODULE=auto and I did not notice that when I posted yesterday.  The code does not compile when GO111MODULE=on The simple instructions that I suggest be added to the documentation would benefit from having a section called "Common e

Re: [go-nuts] Need help/tips on golang compiler souce code reading

2021-02-26 Thread messi...@gmail.com
Thanks for your suggestion, that's a good idea. Any specific ideas about how to do it? After all, the code/design is evolving all the time. On Friday, February 26, 2021 at 8:43:07 AM UTC+8 skinne...@gmail.com wrote: > Ian, I very much appreciate your taking the time to provide the history > he

Re: [go-nuts] Need help/tips on golang compiler souce code reading

2021-02-26 Thread messi...@gmail.com
Thanks a lot for your time, Ian. The history info is very helpful. I'm reading the source code of version 1.15.6, but I found the code base structure on master branch is very different, some changes are refactors as you mentioned above(typechecker), and some are for new features(e.g. generics).

Re: [go-nuts] When using fmt.Print to print a reflect.Value v, v.Elem() is printed instead. Why?

2021-02-26 Thread tapi...@gmail.com
It looks, the fmt package makes some special handling for reflect.Value: package main import "reflect" import "fmt" func main() { var v1 = reflect.ValueOf(0) var p1 = &v1 var v2 = 0 var p2 = &v2 var v3 interface{} = 0 var p3 = &v3 fmt.Println(p1) // fmt.Println(