[go-nuts] Re: Code style in golang compiler

2021-02-08 Thread messi...@gmail.com
Thanks, the commit message explains everything :-) On Tuesday, February 9, 2021 at 11:51:16 AM UTC+8 Luke Champine wrote: > git blame is instructive here. The commit in question is: > https://github.com/golang/go/commit/166b1219b8a5b246c83986c7ecef3d15c85c8150 > > I can't claim to fully

[go-nuts] Re: Code style in golang compiler

2021-02-08 Thread Luke Champine
git blame is instructive here. The commit in question is: https://github.com/golang/go/commit/166b1219b8a5b246c83986c7ecef3d15c85c8150 I can't claim to fully understand the commit message, but I believe that this change will cause the runtime to allocate both values together, rather than

Re: [go-nuts] Code style in golang compiler

2021-02-08 Thread 'Dan Kortschak' via golang-nuts
On Mon, 2021-02-08 at 19:09 -0800, messi...@gmail.com wrote: > Hi, > > I'm reading the go compiler source code and found the following code > style in several places: > > > > Is there some special reasons to group n,m,p to a local struct? > > Why don't we just init n the following way:

[go-nuts] Code style in golang compiler

2021-02-08 Thread messi...@gmail.com
Hi, I'm reading the go compiler source code and found the following code style in several places: [image: DeepinScreenshot_select-area_20210209105635.png] Is there some special reasons to group n,m,p to a local struct? Why don't we just init n the following way: [image:

Re: [go-nuts] about -buildmode c-shared

2021-02-08 Thread Ian Lance Taylor
On Sun, Feb 7, 2021 at 7:02 PM Frédéric De Jaeger wrote: > > Hi, this is a followup of https://groups.google.com/g/golang-dev/c/J7W3sDexK18 > that I've mistakenly posted in the wrong channel. I feel ashamed about it. No need to feel ashamed, it's an easy mistake to make, and a harmless one. >

[go-nuts] Recommendation for Fuzzed Types without Native On-Disk Format

2021-02-08 Thread Matt Proud
Hi all, I want to check the wisdom of the crowd on the following topic: Suppose I am interested in fuzz testing an API using dvyukov/go-fuzz , and the primary API under test accepts relatively complex composite data types itself: func F(*Table) error, where

[go-nuts] Binding interface types on import

2021-02-08 Thread 'Axel Wagner' via golang-nuts
Branched off of "notes on adding generics to a package", to keep separate discussions separate: On Mon, Feb 8, 2021 at 2:47 PM Martin Leiser wrote: > My argument is as follows: The generic package can not use any property of > the parameter type, i.e. the interface type because of the

Re: [go-nuts] WMI and Go... where to get started?

2021-02-08 Thread Brian Candler
Looking at windows_exporter's go.mod file, it uses github.com/StackExchange/wmi. The comments there say it talks to WMI on the local machine, not WMI over the network. On Monday, 8 February 2021 at 15:12:19 UTC aravind...@gmail.com wrote: > Hi, > I don't think there exists WMI client

[go-nuts] Re: [generics] notes on adding generics to a package

2021-02-08 Thread Brian Candler
(Back to the OP's blog post) This is an interesting read, thank you! One question: did you consider using data []*T in the buffer? If so, what made you discount it? It seems a natural way to indicate "empty" slots in the slice. Another way would be a separate slice of bools for marking

Re: [go-nuts] WMI and Go... where to get started?

2021-02-08 Thread Aravindhan K
Hi, I don't think there exists WMI client implementation in Go. You could try cgo with samba WMI implementation https://github.com/greenbone/openvas-smb Thanks, Aravindhan K On Mon, Feb 8, 2021, 1:49 AM Tom Limoncelli wrote: > I've been using Unix for decades (and Go since the pre-releases)

Re: [go-nuts] Filtering a type of test in the whole project

2021-02-08 Thread Jakob Borg
A couple of additional possibilities might be to use the -short flag (have network dependent tests look at testing.Short() and skip) or using environment variables (only run network tests when some variable is set). //jb On 8 Feb 2021, at 15:03, Johan Martinsson wrote: I would like to

[go-nuts] Re: WMI and Go... where to get started?

2021-02-08 Thread Brian Candler
I suggest you take a look at the prometheus wmi_exporter / windows_exporter . This is focussed on collecting metrics, not doing DNS updates, but it may give you a starting point. Note: windows_exporter is the newer version, and I think

Re: [go-nuts] Filtering a type of test in the whole project

2021-02-08 Thread Jan Mercl
On Mon, Feb 8, 2021 at 3:03 PM Johan Martinsson wrote: > Am I missing some option here? It's additionally possible to use a test flag like -mayfail and call flag.Parse() in TestMain(). -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Filtering a type of test in the whole project

2021-02-08 Thread Johan Martinsson
I would like to separate my tests into different test suites. The first one is the regular unit tests and the second one is tests that might fail from time to time (they include external web services). The ways to do this go that I have found are 1. Use build tags 2. Provide a list of

Re: [go-nuts] [generics] notes on adding generics to a package

2021-02-08 Thread Martin Leiser
Am 07.02.2021 um 22:36 schrieb 'Axel Wagner' via golang-nuts: Some immediate thoughts on that: 1. It seems like a strange design decision, to let the importer mess with *any* exported interface type. it is, but it is simple. In general, Go takes a pretty firm stance that the semantics of a

Re: [go-nuts] x/image/font: Font serialization

2021-02-08 Thread Sebastien Binet
‐‐‐ Original Message ‐‐‐ On Friday, February 5th, 2021 at 11:18 PM, Nigel Tao wrote: [...] > > > What's your proposed API? > > > > package sfnt > > > > // Marshal returns the OTF encoding of f. > > > > func Marshal(f Font) ([]byte, error) > > func MarshalWriter(w io.Writer, f Font)

Re: [go-nuts] Go Create

2021-02-08 Thread Kevin Chadwick
I am surprised this did not come up in the thread. I'm not sure if I never knew this was possible or I have forgotten during my time using replace. Turns out, that you can import a folder within the same module folder as mod identifier/package and it is automatically imported by gopls when you