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

2018-12-29 Thread Dan Kortschak
It appears that this is due to the browser not knowing that the downloaded file is UTF-8; adding  to the page fixes the problem. So this is not a Go / "net/http" issue. On Sun, 2018-12-30 at 11:05 +1030, Dan Kortschak wrote: > I am putting together a tiny tool to archive the go.sci

[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 th

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

2018-12-31 Thread Dan Kortschak
Where do we fall down? On Mon, 2018-12-31 at 01:38 -0800, minfo...@arcor.de wrote: > And then Golang doesn't treat complex  > matrix algebra well... -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receivin

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

2019-01-01 Thread Dan Kortschak
Who uses [][]T for this? Gonum has implementations for many of the things that you would need here and other projects provide other aspects. On Tue, 2019-01-01 at 14:52 -0800, minfo...@arcor.de wrote: > > Am Montag, 31. Dezember 2018 23:06:23 UTC+1 schrieb kortschak: > > > > > > Where do we fa

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

2019-01-01 Thread Dan Kortschak
And we have these. On Tue, 2019-01-01 at 15:43 -0800, Pat Farrell wrote: > > On Tuesday, January 1, 2019 at 6:07:03 PM UTC-5, robert engels wrote: > > > > > > Wouldn’t you wrap the slices custom structs with a domain specific  > > interface? You can create whatever notation is needed... > > >

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 d

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

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™ s

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] 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 noti

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, 2

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 -080

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 i

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 a

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

2019-02-06 Thread Dan Kortschak
rom > > > > 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. > > > > > > > > > > &g

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

2019-02-06 Thread Dan Kortschak
O. > > > > > On Feb 6, 2019, at 3:37 PM, Dan Kortschak wrote: > > > > The generalised semantics of Len are that it returns the number of > > available elements in the collection, being a cognate of the len > > built- > > in. This means that as you c

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

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

2019-02-07 Thread Dan Kortschak
need 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

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

2019-02-07 Thread Dan Kortschak
work (primarily 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

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

2019-02-07 Thread Dan Kortschak
se 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
all 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

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"` > > http://

[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 th

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 han

[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 gr

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

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 your

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 was

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 of

Re: [go-nuts] distribution of go executables

2019-02-26 Thread Dan Kortschak
executable (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 no

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 ma

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 f

Re: [go-nuts] distribution of go executables

2019-02-27 Thread Dan Kortschak
3:19 +0300, 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 : > > > &

Re: [go-nuts] distribution of go executables

2019-02-27 Thread Dan Kortschak
ad my 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 : > > > >

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 (n

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

2019-03-03 Thread Dan Kortschak
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 without module support and want to test using modules on the versions that have module support we need to use an approach that works in both of those situati

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

2019-03-04 Thread Dan Kortschak
se github.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

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 o

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

2019-03-06 Thread Dan Kortschak
7;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 [ -

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

2019-03-06 Thread Dan Kortschak
ld 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] 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 T

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 r

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: > T

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 confusi

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: > g

[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 pan

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? If

[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] 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 bec

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 2

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 sou

Re: [go-nuts] Go+ replacement

2019-04-21 Thread Dan Kortschak
This is unfortunate. It was less like that in the past. On Sun, 2019-04-21 at 18:02 -0700, icod.d...@gmail.com wrote: > Nuts is more of a "help I have a problem" thing. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this gro

[go-nuts] why does reading a file on windows add CRLF to unix line endings... sometimes?

2019-04-22 Thread Dan Kortschak
I have a test that is failing on travis on a windows build due to the presence of CRLF in the bytes returned by ioutil.ReadFile. The file itself uses unix line endings, so the CR is inserted by something somewhere along the line. However, this is not always the case. On AppVeyor, I do not see this

Re: [go-nuts] why does reading a file on windows add CRLF to unix line endings... sometimes?

2019-04-22 Thread Dan Kortschak
Solved. This is Travis being "helpful" and setting core.autocrlf=true in git config. https://travis-ci.community/t/files-in-checkout-have-eol-changed-from-l f-to-crlf/349/4 On Tue, 2019-04-23 at 07:50 +0930, Dan Kortschak wrote: > I have a test that is failing on travis on a windows

Re: [go-nuts] Re: Go if else syntax .. suggested replacement

2019-04-24 Thread Dan Kortschak
How would you preclude it? On Wed, 2019-04-24 at 16:28 -0700, lgod...@gmail.com wrote: > I am NOT in favor of allowing nested ternary operations -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving em

Re: [go-nuts] Re: Go if else syntax .. suggested replacement

2019-04-24 Thread Dan Kortschak
: >   //..code block for test=true > case false: >   //..code block for test=false > } > > On Wed, Apr 24, 2019 at 4:42 PM Dan Kortschak > wrote: > > > > > How would you preclude it? > > > > On Wed, 2019-04-24 at 16:28 -0700, lgod...@gmail.com wro

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-25 Thread Dan Kortschak
The difference is that the ternary operator is an expression and the if...else is a statement. If you're only suggesting a syntax change, then the difference becomes one of readability. I'll ask again, how would you preclude nesting without making the language more complex? On Thu, 2019-04-25 at

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-25 Thread Dan Kortschak
Please understand that my use of ?: in the proposed grammar is irrelevant. Using the syntax proposed here leads to the same problem. You have self contradictory claims below: 1. the change is only a swapping of 'if' => '?' and 'else' => ':' with no semantic change: "My proposal  regardin

Re: [go-nuts] multiple array declaration.. Is there a easier way ?

2019-05-01 Thread Dan Kortschak
var T0, T1, T2, T3, T5 [256]uint32 https://play.golang.org/p/6Cm4p_NyD8m On Wed, 2019-05-01 at 18:40 -0700, lgod...@gmail.com wrote: > The following statement seems very awkward, is there a cleaner way to > write  > it ? > > var T0= [256]uint32;  var T1= [256]uint32; var T2= [256]uint32; var > T

Re: [go-nuts] How to detect source of a dependency in go.mod

2019-05-08 Thread Dan Kortschak
Try github.com/sirupsen/logrus@v1.4.1 At some point the capitalisation was changed. On Tue, 2019-05-07 at 19:16 -0700, tamal wrote: > I am trying to convert https://github.com/appscode/voyager from glide > to go  > mod. > > I am getting an error like below: > ``` > go: github.com/Sirupsen/logrus

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

2019-05-08 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 <= l

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? > Specif

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 leng

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

2019-05-12 Thread Dan Kortschak
be documented” 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
> // 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
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 > > sta

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
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] 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

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 be

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 set,

Re: [go-nuts] The strange behavior of defer

2019-05-20 Thread Dan Kortschak
The parameter to fmt.Println is evaluated at the time of the defer statement's execution. You should do something like this instead func main() { start := time.Now() defer func() { fmt.Println(time.Since(start)) }() time.Sleep(10) fmt.Println("Hello, playgro

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 val

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 f

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

2019-05-26 Thread Dan Kortschak
Please don't. Java is not relevant here and the advice given by other prior to this post in the thread is not incorrect. Using atomic operations (in this case it would be atomic.Value's Load and Store methods) invokes a write barrier, which is fundamentally just a memory synchronisation. In pkg syn

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

2019-05-27 Thread Dan Kortschak
gt; For certain, 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.

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
ly, if you are going to argue 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 replyi

Re: [go-nuts] Directly assign map[string]int to map[string]interface{}?

2020-02-23 Thread Dan Kortschak
Have a read of https://research.swtch.com/interfaces. There you'll see that the memory layout of int and interface{} are not the same. This means you can't just treat one as the other, which essentially is what you are asking for. On Sun, 2020-02-23 at 01:12 -0800, Glen Huang wrote: > Hi, > > I h

Re: [go-nuts] Re: Directly assign map[string]int to map[string]interface{}?

2020-02-23 Thread Dan Kortschak
Go is a statically typed language, but the time you get into the case, you must know the concrete type of the v. You allows it to be either map[string]interface{} or map[string]int, this is not a single known type, so the original input type (interface{}) is used. On Sun, 2020-02-23 at 01:24 -0800

Re: [go-nuts] Re: Why isn't there strings.reverse("str") function?

2020-02-27 Thread Dan Kortschak
Why? There's a single correctly sized allocation made up front and then a linear time walk along the encoded runes with truncation after each rune. On Thu, 2020-02-27 at 13:05 -0800, Amnon Baron Cohen wrote: > O(n^2) > > On Thursday, 27 February 2020 18:53:01 UTC, rog wrote: > > If you really jus

Re: [go-nuts] Significance of Mon Jan 2 15:04:05 -0700 MST 2006?

2020-02-28 Thread Dan Kortschak
Rob explained this in a thread a fair while back. > The choice was made by the output of the date command on my Unix > machine. I should have realized the format varies with locale. Mea > culpa. But I can still claim it's easy to remember and well > documented. https://groups.google.com/d/msg/gol

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-02-29 Thread Dan Kortschak
Why can't you spell "with" as "func"? On Sat, 2020-02-29 at 06:16 -0800, Warren Stephens wrote: > I often write a function or module to handle some process that takes > 3 or 4 steps to complete. > > After I am happy with the code I then proceed to write tests for the > code, > but find that I am

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-03-03 Thread Dan Kortschak
The answer to that question is entirely dependent on context, which is stripped by using anonymous labels as you have. For linear things, the second one is clearer, for hierarchical things the first is. It is entirely possible to test each piece of an hierarchical structure; this is the basis for

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-05 Thread Dan Kortschak
I'm really struggling to understand the benefit that you say you'll get. The linear form that the with: label gives you is really just what we already use with a different accent. The cost of testing or not is not substantially different, but the cost of allowing long linear functions, needing addi

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-06 Thread Dan Kortschak
I wrote cybernetic systems for laboratories with LabView a few decades ago. Nothing is worth keeping from that system. On Fri, 2020-03-06 at 00:59 -0800, Warren Stephens wrote: > How many good tools exist now that will turn linear code into a nice > looking readable flow chart? Few? None really?

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-06 Thread Dan Kortschak
Is this helpful for addressing your issue? On Fri, 2020-03-06 at 04:42 -0800, Warren Stephens wrote: > Perhaps I should have referenced MIT's Scratch programming tool??? > "Go is not as good as Scratch" -- THAT would be popular around here I > am sure! -- You received this message because you

[go-nuts] interaction between runtime scheduler and Cgo calls

2020-03-06 Thread Dan Kortschak
This sort of follows on from the EINTR discussion a while back, but was prompted by a claim in the gophers #general slack channel that "the Go scheduler will actively try to interrupt CGO calls that take too long"[1]. This doesn't seem right to me, but I wanted to confirm from people who know (als

Re: [go-nuts] interaction between runtime scheduler and Cgo calls

2020-03-06 Thread Dan Kortschak
Thanks, Ian. On Fri, 2020-03-06 at 14:01 -0800, Ian Lance Taylor wrote: > On Fri, Mar 6, 2020 at 1:40 PM Dan Kortschak > wrote: > > > > This sort of follows on from the EINTR discussion a while back, but > > was > > prompted by a claim in the gophers #general

[go-nuts] go test -race hanging with Go1.14, only with -a flag

2020-03-10 Thread Dan Kortschak
I have a package that is dependent on bazil.org/fuse for testing via a sysfs simulation package github.com/ev3go/sisyphus. For historical reasons, the travis testing used the -a flag (since removed because of the issue described here). Since Go1.14, the standard runtime tests on travis passed, bu

Re: [go-nuts] go test -race hanging with Go1.14, only with -a flag

2020-03-10 Thread Dan Kortschak
On Tue, 2020-03-10 at 22:07 -0700, Ian Lance Taylor wrote: > On Tue, Mar 10, 2020 at 3:25 AM Dan Kortschak > wrote: > > > > I have a package that is dependent on bazil.org/fuse for testing > > via a > > sysfs simulation package github.com/ev3go/sisyphus. > &

Re: [go-nuts] go test -race hanging with Go1.14, only with -a flag

2020-03-10 Thread Dan Kortschak
On Wed, 2020-03-11 at 05:25 +, Dan Kortschak wrote: > On Tue, 2020-03-10 at 22:07 -0700, Ian Lance Taylor wrote: > > On Tue, Mar 10, 2020 at 3:25 AM Dan Kortschak > > wrote: > > > > > > I have a package that is dependent on bazil.org/fuse for testing &

Re: [go-nuts] An important proposal will fail without your support

2020-03-11 Thread Dan Kortschak
Why do you say that? ~/src/golang.org/x/text/message [master*]$ go env GO111MODULE on ~/src/golang.org/x/text/message [master*]$ go version go version go1.14 linux/amd64 ~/src/golang.org/x/text/message [master*]$ go test PASS ok golang.org/x/text/message 0.024s On Wed, 2020-03-11 at

Re: [go-nuts] An important proposal will fail without your support

2020-03-11 Thread Dan Kortschak
Ah, OK. On Wed, 2020-03-11 at 01:58 -0700, miha.vrhov...@gmail.com wrote: > https://github.com/golang/text/pull/9 > > And I cannot find the issue, but there are a few with extract command > not working and crashing. > > On Wednesday, March 11, 2020 at 9:40:36 AM UTC+1, kortschak wrote: > > Why d

Re: [go-nuts] How to break-out of martini middleware

2020-03-14 Thread Dan Kortschak
Note that Martini is not maintained anymore and the original author had a fair bit to say about the merits or otherwise of the packages (via the wayback machine since codegangsta.io is no longer live): https://web.archive.org/web/20160518054801/https://codegangsta.io/blog/2014/05/19/my-thoughts-o

Re: [go-nuts] libgo is more fast that grouting.

2020-03-19 Thread Dan Kortschak
Can you please stop. Numerous non-Google employees contribute to Go. It is not a research project any more than any activity in life is a research project. On Fri, 2020-03-20 at 13:52 +0800, 'Benjamin' via golang-nuts wrote: > I think the team of go programming language should invite other > peopl

Re: [go-nuts] libgo is more fast that grouting.

2020-03-21 Thread Dan Kortschak
Please stop. On Sat, 2020-03-21 at 17:20 +0800, 'Benjamin' via golang-nuts wrote: > Tesla is commodity, but a programming language is not. > > ] > > > > On Mar 20, 2020, at 14:55, Chris Burkert > > wrote: > > > > Do people ask for a Tesla with a combustion engine? No because they > > value w

Re: [go-nuts] Go course

2020-03-25 Thread Dan Kortschak
I don't agree that Go is intrinsically harder than python as a beginner programming language. There are things that are subtle, but these can largely be avoided in the beginner setting. Note that there have been discussions here about using Go as a language for teaching beginners, notably this one

<    1   2   3   4   5   6   7   >