[go-nuts] http.Get not retrieving properly encoded page compared to browser

2018-12-29 Thread Dan Kortschak
I am putting together a tiny tool to archive the go.science G+ group for future archeology. However, I have run into an issue that I don't understand and so don't know how to fix. The code is here: https://play.golang.org/p/1vVm5dvVueS This takes in a the Takeout JSON for the community's posts

Re: [go-nuts] Re: go for robotic control, walking balance, quad flight control

2019-01-02 Thread Dan Kortschak
Yeah, Gonum is 5 years old, and yet because of the design of the language handles some aspects of numerical and scientific coding far better than Matlab/NumPy - the rest is a work in progress. On Wed, 2019-01-02 at 04:26 -0800, minfo...@arcor.de wrote: > Thanks for mentioning Gonum. While IMO it

Re: [go-nuts] scanner.Scan is holding my goroutine ;(

2018-12-13 Thread Dan Kortschak
Can you wrap the call to scanner.Scan in a func that has access to the ccn context and returns false when it's closed? On Thu, 2018-12-13 at 14:04 -0800, Ivan Korjavin wrote: > I have a goroutenie with  scanner.Scan > It looks like: > > ``` > cnn.SetReadDeadline(time.Now().Add(c.rTimeout)) //

Re: [go-nuts] tool to automatically refresh godoc ?

2018-12-21 Thread Dan Kortschak
t; https://godoc.org/-/refresh done On Sat, 2018-12-22 at 07:44 +1030, Dan Kortschak wrote: > A quick read of the gddo source suggests that this should work (but > presumably because I have missed something, it doesn't) > > curl -X POST -F "path=${IMPORTPATH}" https://godoc.o

Re: [go-nuts] tool to automatically refresh godoc ?

2018-12-21 Thread Dan Kortschak
A quick read of the gddo source suggests that this should work (but presumably because I have missed something, it doesn't) curl -X POST -F "path=${IMPORTPATH}" https://godoc.org/-/refresh On Thu, 2018-12-20 at 09:55 +0100, Sebastien Binet wrote: > hi there, > > in all my Go-based projects I

Re: [go-nuts] Re: pass interface

2018-12-10 Thread Dan Kortschak
unction without first creating an instance of that > type. I > don't think it's possible but I would be interested to hear from > someone > who knows more. > > On Mon, Dec 10, 2018 at 1:28 PM Dan Kortschak > wrote: > > > > > No, it is possible, but you need to

Re: [go-nuts] Re: pass interface

2018-12-10 Thread Dan Kortschak
No, it is possible, but you need to pass the pointer to the interface. You can then use reflect to interrogate the interface value. The bigger question, and one that would help here would be what is it that you are actually trying to achieve. On Mon, 2018-12-10 at 08:53 -0600, Mark Volkmann

[go-nuts] tools for testing transport over flakey networks

2018-12-11 Thread Dan Kortschak
Is anyone aware of testing infrastructure for simulating flakey networks without recourse to iptables on linux, i.e. a Go package/type that can be used to to this? thanks Dan -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] tools for testing transport over flakey networks

2018-12-11 Thread Dan Kortschak
Yeah, that's the kind of thing. On Tue, 2018-12-11 at 19:45 -0500, Ian Denhardt wrote: > Quoting robert engels (2018-12-11 19:39:46) > > > > > I am not sure you can do this at the application layer - you need > > kernel support to drop packets. > One could write a mock implementation of e.g.

Re: [go-nuts] Re: pass interface

2018-12-10 Thread Dan Kortschak
Nice is a very strong word. This is the alternative approach that doesn't require a value: https://play.golang.org/p/FoA-GHcr56s (now to the whole list) On Tue, 2018-12-11 at 10:39 +0800, Huiqiang Li wrote: > Nice! i think this is the right answer. > > Dan Kortschak 于2018年12月11日周二

Re: [go-nuts] Re: pass interface

2018-12-10 Thread Dan Kortschak
tr) > fmt.Println("value is", value)// > fmt.Println("method count is", value.NumMethod()) // 0, Why not 3? > } > > func main() { > var ptr *Shape > ReportInterface(ptr) > } > > On Mon, Dec 10, 2018 at 3:28 PM Dan Kortschak > wrote: >

Re: [go-nuts] [ANN] fixed point math library

2018-11-29 Thread Dan Kortschak
On Thu, 2018-11-29 at 17:07 -0600, robert engels wrote: > The dot imports are useful, and others feel the same https://github.c > om/golang/lint/issues/179 > . When you make statements > like,  > > > > > Now given that dot imports are generally

Re: [go-nuts] [ANN] fixed point math library

2018-12-01 Thread Dan Kortschak
Very nice. On Sat, 2018-12-01 at 00:16 -0800, Anthony Martin wrote: > Nigel Tao once said: > > > > Well, there's already context.Context, hash.Hash, image.Image and > > time.Time in the standard library. > All of which are not great. Better names are context.Frame, > hash.Function,

Re: [go-nuts] Package Stutter

2018-12-02 Thread Dan Kortschak
That's pretty different to a dot import in Go. If the imports below gave you  List list = singletonList(someobject) Then they would be comparable - the static imports are more comparable to Go's dot imports, but then in your next post you say that they're mainly used for constants, "although for

Re: [SUSPECTED SPAM][go-nuts] pass interface

2018-12-09 Thread Dan Kortschak
If you want the interface to be interpreted as an interface value and your parameter type is interface{}, you can pass a pointer to the interface value and then work with that. On Sun, 2018-12-09 at 14:23 -0600, Mark Volkmann wrote: > Is it possible to pass an interface to a function in Go? I

Re: [go-nuts] Syntax highlighting (again) [WAS go language sensitive editor?]

2018-11-24 Thread Dan Kortschak
As Ian has said, this is true in some circumstances. When I want to know what something does I will read it. When I am dipping in to refresh my memory or to start investigating a bug, then I read with random access. The latter two are more common. Dan On Sat, 2018-11-24 at 16:06 -0600, robert

Re: [go-nuts] Syntax highlighting (again) [WAS go language sensitive editor?]

2018-11-24 Thread Dan Kortschak
Thanks for bumping this. I had intended to respond. There is a fundamental difference between reading English prose (or whatever your native language is) and code; prose is read as a continuous stream while code is often read in a random access manner. An interesting point here is that natural

Re: [go-nuts] Is conversion between int and uint a no-op i.e. is it free

2018-11-24 Thread Dan Kortschak
int and uint are the same size per the spec, so there is nothing to do (no sign extension and no subsequent truncation). What happens in other languages is largely irrelevant here (golang- nuts). On Sat, 2018-11-24 at 18:16 -0600, robert engels wrote: > This maybe true for Go, but not

Re: [go-nuts] Re: Force pointer at compile time to interface{} parameter

2018-11-19 Thread Dan Kortschak
I don't agree that it was a bad idea. It eases reading and writing in many cases. The mutability of a value is based on the method signature, which is readily available through the godoc. On Mon, 2018-11-19 at 17:57 -0600, Robert Engels wrote: > I understand that. I was stating that the syntactic

Re: [go-nuts] Re: Force pointer at compile time to interface{} parameter

2018-11-19 Thread Dan Kortschak
As Axel points out this is not the case. This can be demonstrated by trying to assign the struct to an interface that has the method you are wanting to call. The following would compile under the rules you're suggesting. It doesn't. https://play.golang.org/p/qRYPaDOPYsl On Mon, 2018-11-19 at

Re: [go-nuts] Trivial(?) Go v2 proposal: Named goroutines and/or named nested funcs

2018-11-25 Thread Dan Kortschak
graphviz 'dot' data, where I place info above each goroutine so it > can be > renamed in the output diagram. That addresses the naming issue within > graphviz diagrams for me, for now. > > > On Sun, 25 Nov 2018 at 15:28, Dan Kortschak du.au> > wrote: > > > >

Re: [go-nuts] Trivial(?) Go v2 proposal: Named goroutines and/or named nested funcs

2018-11-25 Thread Dan Kortschak
That package doesn't introspect on running code, so a goroutine name is not necessary. go-callvis could label the anonymous functions by their filepath:line number or something else. On Sun, 2018-11-25 at 15:12 -0800, Russtopia wrote: > I recently tried out a go tool for outputting code structure

Re: [go-nuts] The most performant deque of all time?

2018-11-27 Thread Dan Kortschak
3:43 PM, robert engels > > > > .com <mailto:reng...@ix.netcom.com>> wrote: > > > > > > > > > > My “none” looks to have been a little strong… Clearly whoever > > > > > wrote the container package believes in testing as the OP. A >

[go-nuts] contracts thought experiment: dimension checks

2018-11-26 Thread Dan Kortschak
Background: As part of the Gonum dev team, I have an interest in using Go for scientific computing. This stems from long experience with unsafe computing environments often used in, particularly, bioinformatics (perl, python and R being standouts in the field, with packages that often use dubious

[go-nuts] Re: contracts thought experiment: dimension checks

2018-11-27 Thread Dan Kortschak
Thanks, Ian. On Mon, 2018-11-26 at 20:46 -0800, Ian Lance Taylor wrote: > On Mon, Nov 26, 2018 at 5:14 PM Dan Kortschak > wrote: > > > > > > Background: > > > > As part of the Gonum dev team, I have an interest in using Go for > > scientific computing. T

Re: [go-nuts] contracts thought experiment: dimension checks

2018-11-27 Thread Dan Kortschak
Yes, this was raised as a possibility by Ian. But this negates a very valuable aspect of matrices that I completely failed to consider in writing the question: the issue of submatrices and how these are valuable. On Mon, 2018-11-26 at 20:49 -0800, Tamás Gulácsi wrote: > Just a silly idea: what if

Re: [go-nuts] The most performant deque of all time?

2018-11-26 Thread Dan Kortschak
container/ring (a arguably non-idiomatic stdlib package does indeed contain this kind of test). It also does not have in code asserts, which are something that I've found to be very rare in Go code. On Mon, 2018-11-26 at 12:09 -0600, robert engels wrote: > I am just offering, and many would

Re: [go-nuts] Github independent issue tracker

2019-01-08 Thread Dan Kortschak
My suspicion is that using the email reply would require that the correspondent be a GitHub user (possibly even a GitHub user subscribed to the issue). This would not be the case for Jan with a bot having filed the issue by proxy. In that case he probably would not even have received any email

Re: [go-nuts] Re: Secure password hashing algorithm in go.

2019-01-07 Thread Dan Kortschak
The problem with this approach is that something that's good enough for This Use™ by the owner of the code will be seen by another person and then used by someone else with less understanding. The world of cryptography implementations is already contaminated enough with badly implemented Correct™

Re: [go-nuts] Re: C++ 11 to Golang convertor

2019-01-07 Thread Dan Kortschak
Note there that cznic/cc has moved to gitlab, at https://modernc.org/cc On Mon, 2019-01-07 at 09:56 -0700, K Davidson wrote: > My original comment was in regaurd to c++11, but seeing as the > discussion > has drifted towards c, you may want to take a look at > https://github.com/xlab/c-for-go, it

Re: [go-nuts] Re: go for robotic control, walking balance, quad flight control

2019-01-04 Thread Dan Kortschak
Julia is a nightmare for peer reviewability. Gonum exists largely because Matlab, NumPy and Julia did not satisfy. On Fri, 2019-01-04 at 00:06 -0800, minfo...@arcor.de wrote: > Am Mittwoch, 2. Januar 2019 22:51:07 UTC+1 schrieb kortschak: > > > > > > Yeah, Gonum is 5 years old, and yet because

[go-nuts] [ANN] delivery for extending Google Takeout for Google+ Communities posts

2018-12-30 Thread Dan Kortschak
I wanted to be able to archive the posts from the go.science Google+ community. So I have made a pico tool that will do this, packaging up the posts and JSON manifest into a zip when given the metadata from Takeout. The tools is available here: https://github.com/kortschak/delivery It requires

Re: [go-nuts] Where can I find the Golang spec source code?

2019-04-02 Thread Dan Kortschak
That is the correct file, just at the wrong commit, here it is for go1.12 https://github.com/golang/go/blob/release-branch.go1.12/doc/go_spec.html On Wed, 2019-04-03 at 11:11 +0800, 李健 wrote: > The web page is at: https://golang.org/ref/spec > > I've searched Google/GitHub but can't find its

Re: [go-nuts] a way to query the module sum of a dependency with the go tool?

2019-03-22 Thread Dan Kortschak
*bump* On Fri, 2019-03-22 at 08:33 +1030, Dan Kortschak wrote: > Is there a command that does something like `go list -m ` but > also outputs the sum for the module and module's go.mod? Other than > `grep go.sum`. > > thanks > Dan > -- You received this message becau

Re: [go-nuts] a way to query the module sum of a dependency with the go tool?

2019-03-23 Thread Dan Kortschak
: > FWIW, none that I'm aware of. If there were to be such a command I > would probably expect it be an option to go mod verify. > > Is there a problem with using go.sum in the way you're proposing? > > Or is this more a convenience thing? > > On Thu, 21 Mar 2019 at 22:

Re: [go-nuts] Re: Why Go? What is the most important feature that led to you becoming a Go programmer?

2019-02-27 Thread Dan Kortschak
For the embedded, https://tinygo.org/, but limited back ends. On Wed, 2019-02-27 at 02:02 -0800, Chris Hopkins wrote: > What brought me to it was the concurrency. I spent my entire career  > frustrated by not only how concurrency wasn't more of a thing in > popular  > languages, but also how so

Re: [go-nuts] distribution of go executables

2019-02-27 Thread Dan Kortschak
, Space A. wrote: > Sorry? You have poor understanding and mess things, so what's wrong? > Being > dilatant is not crime, it's okay unless you start convincing yourself > that > false is true. > > ср, 27 февр. 2019 г. в 22:41, Dan Kortschak : > > > > > Pull your h

Re: [go-nuts] distribution of go executables

2019-02-27 Thread Dan Kortschak
messages, you'll find they > were > focused on topic, not shifting to persons. Thank you for your > participation, it's always good to hear different opinions, even if > they > are not correct. > > ср, 27 февр. 2019 г. в 23:35, Dan Kortschak : > > > > > You're cl

Re: [go-nuts] distribution of go executables

2019-02-27 Thread Dan Kortschak
Pull your head in and stop being rude to people here. On Wed, 2019-02-27 at 17:19 +0300, Space A. wrote: > You have very poor understanding of the subject, messing everything > up. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

Re: [go-nuts] does assembly pay the cgo transition cost / does runtime.LockOSThread() make CGO calls faster?

2019-03-01 Thread Dan Kortschak
Assembly incurs a function call cost (non-inlineable AFAIU), but Cgo incurs a function call cost with additional work for C stack and call conventions translation as said by Tamás. On Fri, 2019-03-01 at 08:13 -0800, Jason E. Aten wrote: > If I include a chunk of assembly .s code in my Go code,

Re: [go-nuts] does assembly pay the cgo transition cost / does runtime.LockOSThread() make CGO calls faster?

2019-03-01 Thread Dan Kortschak
Yes, that's not unreasonable. With f2c, you could potentially get your fortran into C, then Go asm and then call that. Dan On Fri, 2019-03-01 at 20:17 -0800, Jason E. Aten wrote: > On Friday, March 1, 2019 at 6:46:11 PM UTC-6, kortschak wrote: > > > > > > Assembly incurs a function call cost

Re: [go-nuts] distribution of go executables

2019-02-26 Thread Dan Kortschak
Probably not. The executable is a derivative work under most understandings (this is the basis for the GPL to require that source code be provided if the executable is distributed to an end user). Any work writen in Go, using the stdlib (which includes runtime, so all Go programs) is derivative

Re: [go-nuts] distribution of go executables

2019-02-26 Thread Dan Kortschak
e (i.e. not the binary representation of the library). > Go's license is simple and clear. And yet, here we are. The short answer to this question is that a lawyer should be consulted. > > ср, 27 февр. 2019 г., 6:00 Dan Kortschak : > > > > > Probably not. The exec

Re: [go-nuts] Performance comparison of Go, C++, and Java for biological sequencing tool

2019-03-06 Thread Dan Kortschak
It should be pointed out that these three implementations have close to zero testing. In the absence of that, there is little that should be drawn from the integration benchmarks that this suggests. If we relax correct correctness requirements we can get answers in O(1) with small constants. On

Re: [go-nuts] go.mod & go.sum mutability during CI builds

2019-03-06 Thread Dan Kortschak
Can you just check that the vcs diffs them as no diff? e.g. ``` if [ -n "$(git diff -- go.mod go.sum)" ]; then    git diff -- go.mod go.sum exit 1 fi ``` On Wed, 2019-03-06 at 11:07 -0800, eborgst...@nerdwallet.com wrote: > Hi fellow Gophers, > > My company has a requirement in

Re: [go-nuts] go.mod & go.sum mutability during CI builds

2019-03-06 Thread Dan Kortschak
't > waste > time, and I'm looking for something similar with go. > > EB > > On Wed, Mar 6, 2019 at 12:35 PM Dan Kortschak > wrote: > > > > > Can you just check that the vcs diffs them as no diff? > > > > e.g. > > ``` > > if [ -n "$(

Re: [go-nuts] go.mod & go.sum mutability during CI builds

2019-03-06 Thread Dan Kortschak
e build so we don't > waste > time, and I'm looking for something similar with go. > > EB > > On Wed, Mar 6, 2019 at 12:35 PM Dan Kortschak > wrote: > > > > > Can you just check that the vcs diffs them as no diff? > > > > e.g. > > ```

Re: [go-nuts] how to deal with absent go.mod file in tool package when GO111MODULE=on

2019-03-04 Thread Dan Kortschak
com/myitcv/gobin. > > > On Sun, 3 Mar 2019 at 20:56, Dan Kortschak wrote: > > > > > As part of our testing we need to install a tool that currently > > does > > not have go.mod/go.sum files. Since we test on Go versions both > > with > > and wi

Re: [go-nuts] Re: Visual Studio Code oddity with Go

2019-02-21 Thread Dan Kortschak
Please remember to try to make golang-nuts a welcoming venue to discuss Go. The OP has tried to find out a solution and has been unable to. Asking here seems like a reasonable place. On Thu, 2019-02-21 at 17:28 -0800, Space A. wrote: > Nothing comes for free. For example, now you are wasting

Re: [go-nuts] Visual Studio Code oddity with Go

2019-02-21 Thread Dan Kortschak
Have you run `go get -u github.com/mdempsky/gocode` in a terminal? Is the binary put in your $PATH? If you try vim with vim-go or emac with go-mode does gocode work for you there? Dan On Thu, 2019-02-21 at 18:51 -0800, Rich wrote: > Just about every video on Go, I see people using VSC, and so

Re: [go-nuts] [CoC] screenshot images. Lazines or incompetence?

2019-03-11 Thread Dan Kortschak
There is an increasing culture of this in many places. Many students often post screen shots in place of reproducers and textual error. I invariably reply that they need to post code and text. I am not sure I am winning here. Dan On Mon, 2019-03-11 at 11:17 +0100, Wojciech S. Czarnecki wrote: >

Re: [go-nuts] Removing Go's nacl port

2019-03-19 Thread Dan Kortschak
I use it for present to allow students to run code as part of lecture material. Dan On Tue, 2019-03-19 at 11:22 -0700, Brad Fitzpatrick wrote: > We plan to remove Go's Native Client (nacl) port, probably in Go > 1.14. > (It's probably too soon to remove it in Go 1.13) > > Is anybody using it?

Re: [go-nuts] Re: why compiler do not accept elided type in this case ?

2019-03-18 Thread Dan Kortschak
It can infer the type, but from memory, it was decided that for improved safety explicit types should be used. There have been discussion about relaxing this in the past and it is an open proposal. See https://github.com/golang/go/issues/21496 On Mon, 2019-03-18 at 20:01 -0700, zhou yu wrote: >

[go-nuts] -buildmode=shared -linkshared and main: panic?

2019-03-19 Thread Dan Kortschak
I am trying to build an lgo docker image for Go1.10 (working up to Go1.12 with this), but I am finding that the process fails with the following panic. lgo invokes go install with -buildmode=shared -linkshared and I suspect this is the cause of the problem. Is this a known issue? thanks Dan

Re: [go-nuts] goreadme - automate Github Go projects readme files.

2019-03-09 Thread Dan Kortschak
There is also Dave's https://github.com/davecheney/godoc2md, though this is no longer maintained and intended for command line use. On Fri, 2019-03-08 at 05:34 -0800, Eyal wrote: > Hi > > I've created this Github App that automates the creation of readme > files. > It generates for Go project a

Re: [go-nuts] [CoC] screenshot images. Lazines or incompetence?

2019-03-11 Thread Dan Kortschak
My approach to dealing with these it that I set my mail client to text only display. This means that I see plain text where IDE coloured text is pasted, and I don't see images unless I go out of my way to do so. Dan On Mon, 2019-03-11 at 08:36 -0500, Robert Engels wrote: > I think you are

[go-nuts] a way to query the module sum of a dependency with the go tool?

2019-03-21 Thread Dan Kortschak
Is there a command that does something like `go list -m ` but also outputs the sum for the module and module's go.mod? Other than `grep go.sum`. thanks Dan -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

Re: [go-nuts] Request Content Length zero when copy from another Request

2019-02-07 Thread Dan Kortschak
to perform a type switch on known concrete types - it would cast > to an interface declaring Len(), and use the interface, and then it > would work with any type. > > > > > On Feb 7, 2019, at 1:07 PM, Dan Kortschak wrote: > > > > Yeah, I'm not agreeing with you.

Re: [go-nuts] Request Content Length zero when copy from another Request

2019-02-07 Thread Dan Kortschak
On Feb 7, 2019, at 1:05 AM, Dan Kortschak wrote: > > > > Addressing the first sentence, it was a direct answer to a comment > > you > > made: > > > > > > > > But is it really? If you read the description for Len() on > > > bytes.Buffer it i

Re: [go-nuts] Request Content Length zero when copy from another Request

2019-02-07 Thread Dan Kortschak
y since changes to the > doc can/will/might change behavior but it avoids compile time type > checking = brittle code with obscure bugs). > > > > > > On Feb 7, 2019, at 1:56 PM, Dan Kortschak wrote: > > > > I didn't mention the word internal, nor did I imply it

Re: [go-nuts] Request Content Length zero when copy from another Request

2019-02-07 Thread Dan Kortschak
nd use those - especially when the > object being provided as a parameter is already an interface… just > seems lazy… (and long-term error prone). > > > > > > > On Feb 7, 2019, at 3:05 PM, Dan Kortschak wrote: > > > > Their is an assumption in the code that u

Re: [go-nuts] Request Content Length zero when copy from another Request

2019-02-07 Thread Dan Kortschak
cases. > > > > > On Feb 7, 2019, at 3:42 PM, Dan Kortschak wrote: > > > > Keeping a zeroed state is important for the GetBody func because > > the > > io.ReadCloser returned by GetBody can be read and closed. If there > > is > > no zero s

Re: [go-nuts] Request Content Length zero when copy from another Request

2019-02-06 Thread Dan Kortschak
; that > > > > will also have a Len, and NewRequest can set the content > > > > length. If > > > > the Reader does not have Len, then the content length is > > > > unknown. > > > > > > > > > > > > > > > > &

Re: [go-nuts] ZXBasic string slicing

2019-02-11 Thread Dan Kortschak
https://play.golang.org/p/6GqrX15gXZ7 On Mon, 2019-02-11 at 13:04 -0800, Everton Marques wrote: > Funny feature from ZXBasic: > > There is a notation called slicing for describing substrings, and > this can  > be applied to arbitrary string expressions. > > `"abcdef"(2 TO 5)="bcde"` > >

[go-nuts] GAE import of cloud and appengine data stores fails when in same file

2019-02-11 Thread Dan Kortschak
One of our developers has found that when they import both "google.golang.org/appengine/datastore" and "cloud.google.com/go/datastore", renaming the second import to remoteds, the build on AE fails, though it does not fail locally with dev_appserver.py. This only happens when the imports are in

Re: [go-nuts] Request Content Length zero when copy from another Request

2019-02-05 Thread Dan Kortschak
Personally, I think this is a bug in the behaviour of NewRequest. See h ttps://github.com/golang/go/issues/18117 for some additional context. On Tue, 2019-02-05 at 05:18 -0800, matteo.biage...@gmail.com wrote: > I've the following situation:  > I proxy a request to another server and when I made

Re: [go-nuts] why does go test with GO111MODULE=on add self requirement

2019-02-19 Thread Dan Kortschak
Ignore this - pebcak. On Wed, 2019-02-20 at 15:56 +1030, Dan Kortschak wrote: > I am starting to introduce modules to some packages and when I ran > tests a require statement was added to go.mod that is the module > itself. Why would this be a good idea? > -- You received this mes

[go-nuts] why does go test with GO111MODULE=on add self requirement

2019-02-19 Thread Dan Kortschak
I am starting to introduce modules to some packages and when I ran tests a require statement was added to go.mod that is the module itself. Why would this be a good idea? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

Re: [go-nuts] undefined and implementation defined behavior in Go

2019-02-19 Thread Dan Kortschak
Saying something other than "something else" requires that the all of the other possible things that are not currently listed there must be listed. The possible outcomes listed are reasonably likely, but other non-"make demons fly out of your nose" type outcomes are also possible, like "program

Re: [go-nuts] lock for assigning to different elements of an array

2019-02-01 Thread Dan Kortschak
When machines (compilers or processors) are allowed to optimise things, reality gets weird. The compiler may elide the check because it is not conformant with the spec via the memory model, or value A.a may be in a local CPU cache and so never be altered as far as the core is concerned. On Fri,

Re: [go-nuts] Why is "v" prefix for VCS tag required for ?

2019-02-04 Thread Dan Kortschak
The text of for that answer is not saying that a person cannot use "vM.m.p", but that "vM.m.p" means semver M.m.p. They even use `git tag v1.2.3 -m "Release version 1.2.3"` as an example. In the case of Go, the v is a marker that the following is a semver version. On Sun, 2019-02-03 at 02:20

Re: [go-nuts] Modules. A "new" system.

2019-02-05 Thread Dan Kortschak
Robert Griesamer *is* Niklaus Wirth? On Tue, 2019-02-05 at 09:19 -0800, Michael Jones wrote: > Go learns from Oberon via Go and Oberon insider Robert Griesemer, > whose > Wirth-number is zero. > > On Tue, Feb 5, 2019 at 3:47 AM Gerard wrote: > > > > > Hello everyone. There has been one issue

Re: [go-nuts] guarantees on net.Conn and net.UDPConn Read

2019-05-12 Thread Dan Kortschak
> // On MacOS we can see EINTR here if the user > // pressed ^Z.  See issue #22838. > if runtime.GOOS == "darwin" && err == > syscall.EINTR { > continue >

Re: [go-nuts] guarantees on net.Conn and net.UDPConn Read

2019-05-12 Thread Dan Kortschak
ted” to be an implementor - buyer beware! > > We is also why you should never use method names that collide with > “stdlib interfaces” unless you intend them to have the same > semantics. > > > > > On May 12, 2019, at 8:58 PM, Dan Kortschak > > wrote: > > >

Re: [go-nuts] guarantees on net.Conn and net.UDPConn Read

2019-05-12 Thread Dan Kortschak
Further to this, you can see that having two diametrically opposite claims (1. UDPConn.Read implements Conn.Read and Conn is a generic stream-oriented network connection cf 2. UDP is not stream oriented) might be somewhat confusing. On Sun, 2019-05-12 at 20:00 -0700, Kurtis Rader wrote: > And the

Re: [go-nuts] guarantees on net.Conn and net.UDPConn Read

2019-05-12 Thread Dan Kortschak
This is not quite true. The language itself doesn't make claims other than types and method names. However, there are conventions around the semantics of methods in an interface. For example, a Read method that returns 0, nil is allowed for io.Reader, but frowned upon unless the buffer is zero

Re: [go-nuts] guarantees on net.Conn and net.UDPConn Read

2019-05-12 Thread Dan Kortschak
t; > On May 12, 2019, at 10:04 PM, Dan Kortschak > > wrote: > > > > Thank you. I have reviewed the code. I was hoping for some friendly > > and > > helpful input. > > > > On Sun, 2019-05-12 at 21:55 -0500, robert engels wrote: > > > &

Re: [go-nuts] guarantees on net.Conn and net.UDPConn Read

2019-05-12 Thread Dan Kortschak
bump? On Thu, 2019-05-09 at 16:23 +0930, Dan Kortschak wrote: > The Conn and UDPConn Read methods look like io.Reader Read methods, > but > there is no explicit claim that Conn is an io.Reader. Are the Read > methods of these two types identical in behaviour to io.Reader? &g

Re: [go-nuts] guarantees on net.Conn and net.UDPConn Read

2019-05-12 Thread Dan Kortschak
Thank you, that has clarified what I was wanting to confirm. Dan On Sun, 2019-05-12 at 20:00 -0700, Kurtis Rader wrote: > On Sun, May 12, 2019 at 7:38 PM Dan Kortschak > wrote: > > > > > Yes, I'm aware of all this. However, the net.UDPConn Read method > > states &

Re: [go-nuts] Data race question in config package of harvester

2019-05-27 Thread Dan Kortschak
ertain, most programs do not need these techniques but > dissuading someone from understanding and/or using them because they > are “being clever” is not appropriate. > > > > On May 26, 2019, at 6:59 PM, Dan Kortschak > > wrote: > > > > Please don't. Java is not r

Re: [go-nuts] Is this a bug?

2019-05-24 Thread Dan Kortschak
The interfaces that define the contracts should come from a third package/source. The issue that I suspect you are hitting is that type identity for interface types is based on the name, not the method set. This means that, for example with your code below a function PrintB(StringerB) and another

Re: [go-nuts] Data race question in config package of harvester

2019-05-27 Thread Dan Kortschak
rry if you think I put words in your mouth, I did not mean to. > > Can you please explain what "Please don’t” means then? I took it at > face value, and that it was a affirmative response to “Don’t be > clever." > > > > > On May 27, 2019, at 7:33 AM, Dan Kor

Re: [go-nuts] Data race question in config package of harvester

2019-05-27 Thread Dan Kortschak
rgue against the points, feel free to do > so, but incorrectly changing the argument or my position is not very > welcome.  > > > > > On May 27, 2019, at 6:51 PM, Dan Kortschak > > wrote: > > > > In the post that I was replying to you told the O

Re: [go-nuts] How can I read private field in go struct instance

2019-06-03 Thread Dan Kortschak
Sorry, missed the go- prefix in Dave's package. github.com/davecgh/go-spew On Tue, 2019-06-04 at 09:48 +0930, Dan Kortschak wrote: > There are packages already available for this. > > github.com/kortschak/utter (for Go syntax-like printing) > github.com/davecgh/spew (for less Go

Re: [go-nuts] How can I read private field in go struct instance

2019-06-03 Thread Dan Kortschak
There are packages already available for this. github.com/kortschak/utter (for Go syntax-like printing) github.com/davecgh/spew (for less Go syntax-like printing) On Mon, 2019-06-03 at 08:54 -0700, 杜沁园 wrote: > I recently write a program to recursively print all fields and value > in a  >

Re: [go-nuts] How can I read private field in go struct instance

2019-06-03 Thread Dan Kortschak
在 2019年6月4日星期二 UTC+8上午8:19:55,kortschak写道: > > > > > > Sorry, missed the go- prefix in Dave's package.  > > > > github.com/davecgh/go-spew  > > > > On Tue, 2019-06-04 at 09:48 +0930, Dan Kortschak wrote:  > > > > > > There are packa

Re: [go-nuts] how to prevent go1.13 go directive being written in an go directive-free go.mod?

2019-06-10 Thread Dan Kortschak
apparent value. [1]https://github.com/golang/go/issues/30791#issuecomment-472431458 On Mon, 2019-06-10 at 22:27 -0700, Ian Lance Taylor wrote: > On Mon, Jun 10, 2019 at 9:56 PM Dan Kortschak > wrote: > > > > > > The semantics of this line of go.mod is not described anywhe

[go-nuts] how to prevent go1.13 go directive being written in an go directive-free go.mod?

2019-06-10 Thread Dan Kortschak
The semantics of this line of go.mod is not described anywhere, but the tool chain blithely writes it to a go.mod file when there is no go directive present. Is there a way to mark the go.mod as go version-agnostic? -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] how to prevent go1.13 go directive being written in an go directive-free go.mod?

2019-06-12 Thread Dan Kortschak
Thanks, Ian. I'll look later today. Dan On Wed, 2019-06-12 at 07:01 -0700, Ian Lance Taylor wrote: > On Tue, Jun 11, 2019 at 6:30 PM Dan Kortschak > wrote: > > > > Having that and exactly what it means in the go help modules output > > would probably be the best out

Re: [go-nuts] how to prevent go1.13 go directive being written in an go directive-free go.mod?

2019-06-12 Thread Dan Kortschak
For others, the cl is https://golang.org/cl/181840 (note the extra 0). On Wed, 2019-06-12 at 07:01 -0700, Ian Lance Taylor wrote: > On Tue, Jun 11, 2019 at 6:30 PM Dan Kortschak > wrote: > > > > Having that and exactly what it means in the go help modules output > > wo

Re: [go-nuts] how to prevent go1.13 go directive being written in an go directive-free go.mod?

2019-06-12 Thread Dan Kortschak
I feel your pain. For me it's at the other end of the keyboard. Dan On Wed, 2019-06-12 at 17:01 -0700, Ian Lance Taylor wrote: > On Wed, Jun 12, 2019 at 2:55 PM Dan Kortschak > wrote: > > > > For others, the cl is https://golang.org/cl/181840 (note the extra > > 0

Re: [go-nuts] Go Language Survey

2019-06-12 Thread Dan Kortschak
This is interesting. I have exactly the opposite situation; up-down is much easier than significant left-right because of faulty saccades. On Wed, 2019-06-12 at 11:41 -0700, Michael Jones wrote: > Bakul, more good arguments. I have another motivation in the "?" > world that > I've not argued

Re: [go-nuts] how to prevent go1.13 go directive being written in an go directive-free go.mod?

2019-06-11 Thread Dan Kortschak
Thanks, Ian. Comments in-line. On Tue, 2019-06-11 at 06:42 -0700, Ian Lance Taylor wrote: > On Tue, Jun 11, 2019 at 6:40 AM Ian Lance Taylor > wrote: > > > > On Mon, Jun 10, 2019 at 10:51 PM Dan Kortschak > > wrote: > > > > > > The

Re: [go-nuts] how to prevent go1.13 go directive being written in an go directive-free go.mod?

2019-06-11 Thread Dan Kortschak
c13). Dan On Tue, 2019-06-11 at 17:35 -0700, Ian Lance Taylor wrote: > On Tue, Jun 11, 2019 at 4:53 PM Dan Kortschak > wrote: > > > > > > It would be very nice if the documentation and clarity of > > communication > > around this were improved. > I strug

Re: [go-nuts] Re: guarantees on net.Conn and net.UDPConn Read

2019-05-13 Thread Dan Kortschak
Thanks, Jake. This was very helpful. On Mon, 2019-05-13 at 09:19 -0700, jake6...@gmail.com wrote: > On Thursday, May 9, 2019 at 2:54:17 AM UTC-4, kortschak wrote: > > > > > > The Conn and UDPConn Read methods look like io.Reader Read methods, > > but  > > there is no explicit claim that Conn is

Re: [go-nuts] Re: guarantees on net.Conn and net.UDPConn Read

2019-05-13 Thread Dan Kortschak
Yes. There's also the unfortunate collision with io.ReaderFrom's method name which is directionally opposite to net.PacketConn's ReadFrom. This is unfixable because of Go1. Dan On Mon, 2019-05-13 at 15:14 -0700, Ian Lance Taylor wrote: > On Mon, May 13, 2019 at 2:45 PM Dan Kortschak >

Re: [go-nuts] gob Decode cannot override "true" value with "false"

2019-05-20 Thread Dan Kortschak
This is because zero values are not sent by encoding/gob. So the false value never goes over the wire to overwrite the true. If you want things to be zeroable, you need to do that yourself before decoding. From https://golang.org/pkg/encoding/gob/#hdr-Encoding_Details "If a field has the zero

Re: [go-nuts] Re: the Dominance of English in Programming Languages

2019-05-17 Thread Dan Kortschak
:) In Gonum source/text, we have a policy of ASE in user-facing documentation, but all my internal comments and commit messages are written in BE (though read by me in AuE). We also avoid usages that are ambigiguous when read in BE/AuE or grammatically incorrect when read in those dialects (the

Re: [go-nuts] Re: the Dominance of English in Programming Languages

2019-05-17 Thread Dan Kortschak
On Sat, 2019-05-18 at 09:43 +1000, Rob Pike wrote: > Australia is closer to Britain but sticks with jail > and tire. I don't think this is true Australia wide - in Melbourne and Adelaide (my home cities), I have always seen gaol and tyre. > I'm sure every English speaking country has its own

[go-nuts] guarantees on net.Conn and net.UDPConn Read

2019-05-09 Thread Dan Kortschak
The Conn and UDPConn Read methods look like io.Reader Read methods, but there is no explicit claim that Conn is an io.Reader. Are the Read methods of these two types identical in behaviour to io.Reader? Specifically, are the reads allowed to fill the buffer with arbitrary numbers of bytes in 0 <=

<    1   2   3   4   5   6   7   >