[go-nuts] Re: HTTPS proxy issue using CONNECT method

2022-12-05 Thread gbarr
Hi Mauro, In your curl examples the CONNECT method was used in both cases because you forced it to with the --proxytunnel option. If you run those same commands without that option then you will find that curl will operate the same as Go and will only use the CONNECT method when the target is H

Re: [go-nuts] Re: Golang Github Package References

2022-12-05 Thread Peter Galbavy
Also, if you are concerned about the availability of the packages in the future, use vendoring to pull in a copy of the sources to the repo: https://go.dev/ref/mod#go-mod-vendor Peter On Monday, 5 December 2022 at 13:35:25 UTC Brian Candler wrote: > On Monday, 5 December 2022 at 13:12:26 UTC l

Re: [go-nuts] Re: Why not tuples?

2022-12-05 Thread Robert Engels
I worked on a system one time - in Java - that used a Sextuplet. I kid you not. Please. Please. Please use typed structures and save the futures maintainers they pain. It’s a little extra work up front that pays big dividends. > On Dec 5, 2022, at 9:39 PM, Diogo Baeder wrote: > >  > Hi folks

Re: [go-nuts] Re: Why not tuples?

2022-12-05 Thread Diogo Baeder
Hi folks, Thanks for all the inputs, I really appreciate the effort and help :-) Regardless of the whole discussion of whether or not tuples are a good or bad data structure, they exist out there in the wild, and we have to deal with them in many situations - of course, in our own code we can o

Re: [go-nuts] Golang 1.19+ preemption model on a preemptive linux kernel?

2022-12-05 Thread robert engels
I don’t think the analysis by alphadose in the issue you cite is correct. Go added async pre-emption (via signals) and I believe it can preempt a Go thread anywhere but in an internal critical section. Ian would know for sure. It is certainly not only at a function call boundary because that wou

[go-nuts] Re: HTTPS proxy issue using CONNECT method

2022-12-05 Thread Mauro Monteiro
Hello Graham, Would not make more sense to deal with both cases HTTPS and HTTP in the same way? The transport could send the CONNECT method to establish the TCP tunnel and then send the request after that. Of course, if the target request is based on HTTPS, the TLS handshake would start otherwi

Re: [go-nuts] Golang 1.19+ preemption model on a preemptive linux kernel?

2022-12-05 Thread Andrew Athan
In brief then, in the presence of os threads running on a kernel that can preempt threads, it is incorrect to assume that any two statements within a goroutine will run atomically (both run, or not at all), irrespective of the simplicity of those statements, or whether any function calls involve

Re: [go-nuts] Golang 1.19+ preemption model on a preemptive linux kernel?

2022-12-05 Thread Andrew Athan
The statement I made is actually a bit stronger than the one you confirmed: Even if the goroutines are using atomic load/store, the preemtive nature of the os threads could easily interrupt one goroutine between an atomic load and its use of that value, giving another goroutine the opportunity t

Re: [go-nuts] Re: Looking Backend Dev Learning Resources

2022-12-05 Thread Christoph Berger
> that would mean the progress made did not invalidate any of effective Go (which seems not possible given the addition of generics) Adding new features makes Effective Go *incomplete* but not *invalid*. There is separate documentation available for Generics and other new features. Go documenta

Re: [go-nuts] Re: Looking Backend Dev Learning Resources

2022-12-05 Thread 'Dan Kortschak' via golang-nuts
On Mon, 2022-12-05 at 14:54 -0600, Robert Engels wrote: > Can you elaborate on that reference? At first review, it means you > are putting in lots of effort making lots of progress (anti red > queen) but that would mean the progress made did not invalidate any > of effective Go (which seems not pos

Re: [go-nuts] Re: Looking Backend Dev Learning Resources

2022-12-05 Thread Robert Engels
Can you elaborate on that reference? At first review, it means you are putting in lots of effort making lots of progress (anti red queen) but that would mean the progress made did not invalidate any of effective Go (which seems not possible given the addition of generics). I’m doubting you impl

Re: [go-nuts] Re: Looking Backend Dev Learning Resources

2022-12-05 Thread 'Dan Kortschak' via golang-nuts
On Mon, 2022-12-05 at 09:27 -0800, Tsvetomir Lazarov wrote: > How relevant is Effective Go actually, given the January 2022 update > that this document has not been updated significantly since 2009? Still relevant. This is one of the virtues of having a language that is not built on the Red Queen

Re: [go-nuts] Golang 1.19+ preemption model on a preemptive linux kernel?

2022-12-05 Thread Robert Engels
I have some examples of lock-free structures at github.com/robaho/go-concurrency-test Most lock-free structures should not depend on OS scheduling. Some that use “cpu id “ to partition would. > On Dec 5, 2022, at 12:02 PM, Andrew Athan wrote: > > I'm having trouble finding definitive inform

Re: [go-nuts] Golang 1.19+ preemption model on a preemptive linux kernel?

2022-12-05 Thread Ian Lance Taylor
On Mon, Dec 5, 2022 at 10:03 AM Andrew Athan wrote: > > I'm having trouble finding definitive information about golang's preemption > model when running with GOMAXPROCS>1 on a multi-core Intel with preemtive > linux kernel. > > As I understand it, in such a scenario, two goroutines may be schedu

[go-nuts] Re: Looking Backend Dev Learning Resources

2022-12-05 Thread Tsvetomir Lazarov
How relevant is Effective Go actually, given the January 2022 update that this document has not been updated significantly since 2009? On Thursday, December 1, 2022 at 6:33:01 PM UTC+2 marc...@gmail.com wrote: > https://mehdihadeli.github.io/awesome-go-education/ > > Op woensdag 30 november 2022

Re: [go-nuts] proposal: Qo

2022-12-05 Thread gonads
Less specific. Qo Language (Quantum Computing Language). Qo Cloud (Computing). Qo Serverless (Computing). Qo Commercials (Go Team Members). Set the Status Quo, with Qo. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from thi

[go-nuts] Valgo is a type-safe, expressive, and extensible validator library for Golang.

2022-12-05 Thread Carlos Forero
https://github.com/cohesivestack/valgo Valgo is in its early stages. We would like community feedback before releasing version 1. -- 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,

[go-nuts] Golang 1.19+ preemption model on a preemptive linux kernel?

2022-12-05 Thread Andrew Athan
I'm having trouble finding definitive information about golang's preemption model when running with GOMAXPROCS>1 on a multi-core Intel with preemtive linux kernel. As I understand it, in such a scenario, two goroutines may be scheduled by the go runtime onto two separate system threads on two s

Re: [go-nuts] Get network interface values

2022-12-05 Thread 'Axel Wagner' via golang-nuts
This isn't really something that can be solved, in Go or otherwise. The operating system only knows that a given interface is connected to a network, it doesn't know whether that network is routes to the internet. Any piece of software that actually checks of you are "connected to the internet" do

Re: [go-nuts] Re: Golang Github Package References

2022-12-05 Thread Brian Candler
On Monday, 5 December 2022 at 13:12:26 UTC loji...@gmail.com wrote: > The problem as I see it, is that when the security of the code relies on a > package is outside the main program/executable, it can open potential > problems of code injection; code changes or forks or if the url has moved, >

Re: [go-nuts] Re: Golang Github Package References

2022-12-05 Thread Mucas Schlack
Ok, The package code in question looks like this: - import ( "context" "encoding/json" "flag" "fmt" "io" "log" "net/http" "net/http/httputil" "net/url" "os" "time" "github.com/go-oauth2/oauth2/v4/generates" "github.com/go-oauth2/oauth2/v4/errors" "github.com/go-oauth2/oauth2/v4/manage" "github.com

[go-nuts] Get network interface values

2022-12-05 Thread Nikhilesh Susarla
Hi, I want to check if my system is connected to internet or not. 1. Say I may be connected to wifi but there is no internet. 2. Connected in lan but there is no internet So, I want a low level package to get the status of the network card or related in Go. Rather than just querying google.com

[go-nuts] Re: Issue with regular expression processing

2022-12-05 Thread Brian Candler
For the documentation of the RE2 regular expression dialect, see https://github.com/google/re2/wiki/Syntax ^ matches only at start of string, unless you set multi-line mode: https://go.dev/play/p/GCglWdjqEHq On Monday, 5 December 2022 at 12:10:20 UTC sbezv...@cisco.com wrote: > Hello, > > > >

[go-nuts] Issue with regular expression processing

2022-12-05 Thread sbezverk
Hello, I came across a strange behavior in regular expression processing, please see the following simple code which is supposed to match the second line of data variable. https://go.dev/play/p/QPrNRuhCv8r The matching data starts at the beginning of the 3rd line so I expect the patt

Re: [go-nuts] Re: go install of forked repo

2022-12-05 Thread Robert Engels
As I mentioned in the other thread - isn’t that made more complicated because the module author (the module that is imported) doesnt use relative packages references? If they did wouldn’t this be simpler? > On Dec 5, 2022, at 5:32 AM, Brian Candler wrote: > > Or there is vendoring. > >> On M

Re: [go-nuts] Re: Golang Github Package References

2022-12-05 Thread Robert Engels
The op is trying to say, they wrote the code using github.com/robaho/fixed but then they decide they want to use a fork of fixed (maybe it is being maintained better, performance enhancements, etc) but they don’t want to change all of their code. Can they use a replace directive to point at th

[go-nuts] Re: Golang Github Package References

2022-12-05 Thread Brian Candler
This question makes no sense to me. If your code actually *uses* "github.com/installed-package" then it will fail to build or run without it. On the other hand, if it doesn't use it, then just remove the import (the compiler will complain about unused imports anyway) I also don't know what yo

Re: [go-nuts] Re: go install of forked repo

2022-12-05 Thread Brian Candler
Or there is vendoring . On Monday, 5 December 2022 at 09:16:24 UTC stephane@gmail.com wrote: > Hi, > > If you don't want to commit *go.mod*, you can use *go.work > *https://go.dev/ref/mod#go-work-file > > On Monday, December 5, 2022 at

[go-nuts] Golang Github Package References

2022-12-05 Thread Mucas Schlack
Hello Everyone, I would like to install a Golang Github package, but I do not want to keep referencing the installed package in the "imports" section of the code - for security reasons, and because I want my code to be able to run without those references. Does anyone know if there is a way to d

Re: [go-nuts] Re: go install of forked repo

2022-12-05 Thread Stéphane Jeandeaux
Hi, If you don't want to commit *go.mod*, you can use *go.work * https://go.dev/ref/mod#go-work-file On Monday, December 5, 2022 at 9:52:17 AM UTC+1 kortschak wrote: > On Sun, 2022-12-04 at 23:47 -0800, 'Christian Stewart' via golang-nuts > wrote: > > I definitely fork things and use "replace"

Re: [go-nuts] Re: go install of forked repo

2022-12-05 Thread 'Dan Kortschak' via golang-nuts
On Sun, 2022-12-04 at 23:47 -0800, 'Christian Stewart' via golang-nuts wrote: > I definitely fork things and use "replace" quite frequently. It *can* be used, but it is not the solution in the general case as Volker said. A replace in a library's go.mod file has no effect on consumers of that libr

[go-nuts] Re: HTTPS proxy issue using CONNECT method

2022-12-05 Thread gbarr
On Saturday, December 3, 2022 at 4:46:54 PM UTC maumon...@gmail.com wrote: > Hello all, > > I have been facing an issue when I try to create a HTTP client which needs > to connect through a HTTPS proxy using the HTTP CONNEC method. I know that > it can be achieved setting my own http.Transport o