Re: [go-nuts] Re: Differences between go1.16 and go1.15 ?

2021-02-24 Thread Volker Dobler
On Wed, 24 Feb 2021 at 20:00, Ian Lance Taylor wrote: > On Sat, Feb 20, 2021 at 8:26 AM Volker Dobler > wrote: > > > > 1. Do not use go run main.go. Never! > > I want to point out that this is too strong. There are perfectly good > reasons to use "go run main.go". It's a simple convenience ope

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

2021-02-24 Thread messi...@gmail.com
Hi, I'm trying to read golang compiler source code and now have come to the middle of syntax analysis: just finished parser.fileOrNil , next step is noder.node()

[go-nuts] Re: Module dependency cycles

2021-02-24 Thread 'Bryan C. Mills' via golang-nuts
In general the way to cut cycles is to cut a set of versions of the affected modules such that each module in the set requires only the other versions in that set. (So, a new `thanos` v0.19.0, a new `cortex` v1.8.0, and a new `alertmanager` v0.22.0, I think?) The trick is to publish all of them

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

2021-02-24 Thread Ian Lance Taylor
On Wed, Feb 24, 2021 at 5:24 PM rob wrote: > > I was unclear. > > My directories are structured so that each is its own program. For > example, I have programs w/ these names, and the code is in that > directory. That's how I understood GOPATH was supposed to be organized > > ~/go/src/dsrt > > ~/

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

2021-02-24 Thread Ralph Seichter
* rob: > I'm also curious as to WHY GOPATH is being removed. Because GOPATH forced people to store all their Go code under a specific directory, which is a hindrance. go.mod allows users to choose different paths for different projects. It also enables programmers to use Git or other VCS to store

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

2021-02-24 Thread rob
And another question.  Some of my code is defined as package main and other code directories are package calc as it is intended to be imported by other of my code packages. Am I expected to run go mod init on all of my code, or only those that are imported by package main code? Please forg

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

2021-02-24 Thread rob
I was unclear. My directories are structured so that each is its own program. For example, I have programs w/ these names, and the code is in that directory.  That's how I understood GOPATH was supposed to be organized ~/go/src/dsrt ~/go/src/regex ~/go/src/comparehashes There are at least

Re: [go-nuts] Orderly exit

2021-02-24 Thread Kevin Chadwick
On February 24, 2021 11:37:05 PM UTC, robert engels wrote: >A simple slice OOB causes a panic - this is why many robust servers >will catch & recover so a single OOB due to bug triggered by rare >input/state doesn’t crash the server for 1000’s of users. It might >still cause problems due to resou

Re: [go-nuts] Orderly exit

2021-02-24 Thread robert engels
A simple slice OOB causes a panic - this is why many robust servers will catch & recover so a single OOB due to bug triggered by rare input/state doesn’t crash the server for 1000’s of users. It might still cause problems due to resource exhaustion, but properly designed exception/error handling

Re: [go-nuts] Orderly exit

2021-02-24 Thread robert engels
You can read the section ‘Apache Vulnerabilities’ and the difference in forking vs multi-threader Apache configuration and how that triggers a DoS. See https://www.feistyduck.com/library/apache-security/online/apachesc-CHP-5.html > On Feb 24, 2021, at 5:16 PM, robert engels wrote: > > I’m sorr

Re: [go-nuts] Orderly exit

2021-02-24 Thread Kevin Chadwick
On February 24, 2021 11:16:46 PM UTC, robert engels wrote: >I’m sorry but that is not correct. If you have a “server process” that >handles requests for 1000’s of clients - terminating the process due to >an exception/panic easily leads to a DoS attack. The bad actor only >needs to send similar r

Re: [go-nuts] Orderly exit

2021-02-24 Thread robert engels
I’m sorry but that is not correct. If you have a “server process” that handles requests for 1000’s of clients - terminating the process due to an exception/panic easily leads to a DoS attack. The bad actor only needs to send similar requests infrequently to affect thousands of users - especially

Re: [go-nuts] Orderly exit

2021-02-24 Thread Kevin Chadwick
On February 24, 2021 8:00:36 PM UTC, Robert Engels wrote: >Depending on other infrastructure that can easily lead to easy DoS >attacks. Utter nonsense, more likely the opposite, if any difference at all. -- You received this message because you are subscribed to the Google Groups "golang-nut

Re: [go-nuts] Why GO111MODULE=auto go get does not always work?

2021-02-24 Thread Peng Yu
Hi Shulhan, > https://golang.org/ref/mod#mod-commands > > If you run the "go get" command on directory that does not contains "go.mod" > file, its basically equal to "GO111MODULE=off go get", without module > aware. > > Where do you get the above commands? I made them up. > rsc.io/quote is an ex

Re: [go-nuts] Orderly exit

2021-02-24 Thread Robert Engels
Depending on other infrastructure that can easily lead to easy DoS attacks. > On Feb 24, 2021, at 12:15 PM, Kevin Chadwick wrote: > > On 2/24/21 9:53 AM, roger peppe wrote: >> On Tue, 23 Feb 2021 at 12:10, Kevin Chadwick > > wrote: >> >>I only instigate panic m

Re: [go-nuts] Why GO111MODULE=auto go get does not always work?

2021-02-24 Thread Shulhan
> On 25 Feb 2021, at 01.40, Peng Yu wrote: > > Hi, > > `GO111MODULE=auto go get` does not always work. What causes this bug? Thanks. > > $ GO111MODULE=auto go get golang.org/x/net/html > $ GO111MODULE=auto go get rsc.io/quote > /Users/xxx/go/src/rsc.io/quote/quote.go:8:8: code in directory >

[go-nuts] Re: Module dependency cycles

2021-02-24 Thread Andy Bursavich
To summarize the concrete issue: An old version of Prometheus pulled in k8s.io/client-go@v12.0.0+incompatible . An old version of Alertmanager pulled in that version of Prometheus. An old version of Cortex pulled in that version of Alertmanager. An old version of Thanos pulled in that version of C

Re: [go-nuts] Re: Differences between go1.16 and go1.15 ?

2021-02-24 Thread Ian Lance Taylor
On Sat, Feb 20, 2021 at 8:26 AM Volker Dobler wrote: > > 1. Do not use go run main.go. Never! I want to point out that this is too strong. There are perfectly good reasons to use "go run main.go". It's a simple convenience operation that does what it says. If you have a single file Go main pac

[go-nuts] Why GO111MODULE=auto go get does not always work?

2021-02-24 Thread Peng Yu
Hi, `GO111MODULE=auto go get` does not always work. What causes this bug? Thanks. $ GO111MODULE=auto go get golang.org/x/net/html $ GO111MODULE=auto go get rsc.io/quote /Users/xxx/go/src/rsc.io/quote/quote.go:8:8: code in directory /Users/xxx/go/src/rsc.io/quote/v3 expects import "rsc.io/quote"

Re: [go-nuts] Re: Cannot build after upgrading to Go 1.16

2021-02-24 Thread 'simon place' via golang-nuts
On Wednesday, 24 February 2021 at 08:10:01 UTC jonr...@gmail.com wrote: > i had a similar experience where i ended up pull-requesting the addition > of mod&sum into a dependency. fair enough for actively maintained packages > or packages you've contributed to before but could be problematic >

Re: [go-nuts] Orderly exit

2021-02-24 Thread Kevin Chadwick
On 2/24/21 9:53 AM, roger peppe wrote: > On Tue, 23 Feb 2021 at 12:10, Kevin Chadwick > wrote: > > I only instigate panic manually for one thing. Perhaps that will change, > but > I doubt it. > > If I want to send out or write a log to disk then I will ca

[go-nuts] Re: Module dependency cycles

2021-02-24 Thread Andy Bursavich
s/transient/transitive/ -- 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 email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https:

[go-nuts] Module dependency cycles

2021-02-24 Thread Andy Bursavich
I’m trying to get rid of a transient dependency on k8s.io/client-go@v12.0.0+incompatible and I’ve tracked it down to the co-dependency of Thanos and Cortex... Presumably, there isn't a dependency cycle in their packages, but there is in their modules (at different versions). The two update thei

[go-nuts] Guide to Pub/Sub in Golang

2021-02-24 Thread Ramiro Nuñez Dosio
Hello everyone 👋 Wanted to share this new post we just published at Ably, focused on Pub/Sub in Go, including what it is, when to use it, scaling it, and how to implement it in a Go Chat app (including history and presence). Guide to Pub/Sub in Golang H

[go-nuts] golang.org/x/crypto/ssh: Error message "wait: remote command exited without exit status or exit signal

2021-02-24 Thread Steffen Wentzel
Dear community, I'm currently trying to write a simple ssh client using golang.org/x/crypto/ssh. My question is: When using ssh.Session.Stdin, which is an io.Reader interface, what triggers a call to the actual Read method? I seem to lack some fundamentals understanding of how this works, I j

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

2021-02-24 Thread Yan Titarenko
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 project - there could be other projects/use cases, which could a cause for contributions, into the reflection library). I tried to test wi

Re: [go-nuts] Orderly exit

2021-02-24 Thread roger peppe
On Tue, 23 Feb 2021 at 12:10, Kevin Chadwick wrote: > I only instigate panic manually for one thing. Perhaps that will change, > but I doubt it. > > If I want to send out or write a log to disk then I will call panic rather > than os.exit, upon a log.fatal scenario. Think buffered go routine logg

Re: [go-nuts] Re: Cannot build after upgrading to Go 1.16

2021-02-24 Thread Amnon
Go modules were introduced back in 2018, so we have had a good few years to migrate. In most cases migrating simply means running go mod init, and commiting the go.mod and go.sum files. Migrating does cause a small amount of pain. But it will improve your life as a developer. The existence of

Re: [go-nuts] Re: Cannot build after upgrading to Go 1.16

2021-02-24 Thread Jon Reiter
i had a similar experience where i ended up pull-requesting the addition of mod&sum into a dependency. fair enough for actively maintained packages or packages you've contributed to before but could be problematic otherwise. (insert any linux/bsd talk about contributing changes upstream here) it