Re: [go-nuts] Bug? go/src/all.bash on master branch fails in go/build test with Go1.18

2022-04-07 Thread tenkoh
I have heard about build dashboard for the first time. Thanks! I will check it. 2022年4月7日木曜日 14:45:39 UTC+9 axel.wa...@googlemail.com: > The master branch is used for the active development and not for general > consumption. It is not unusual for builds/tests to fail on it occasionally. > You

Re: [go-nuts] Why is it forbidden to add methods to an existing type?

2022-04-07 Thread Sam Hughes
Like, I get that the extra type-pointer for a declared struct of float64+bool isn't that big of a deal, I do wish we could express tuple types naturally. What you suggest is probably the closest we get for now. For `if v, ok := value.(bool); ok && v`, the value is tuly 0. For `if v, ok := value

[go-nuts] Generics: Self Referencing Constraint Types

2022-04-07 Thread jfcg...@gmail.com
Hi, please take a look . The aim is to write a HaveLess constraint that will work with any type like Large, without any reflection / traditional interfaces / dictionaries etc., just plain method calls. How would you write this? Keep in mind that type Large is

[go-nuts] Re: Execution of goroutines

2022-04-07 Thread golf_mike
Ok, thanks that makes sense! On Wednesday, April 6, 2022 at 6:56:42 PM UTC+2 Brian Candler wrote: > > Is there maybe something blocking involved in http.Get()? > > Yes of course - first establishing a TCP connection across the network, > then sending data over it and waiting for the response. > >

Re: [go-nuts] Generics: Self Referencing Constraint Types

2022-04-07 Thread 'Axel Wagner' via golang-nuts
At its core, this is this restriction of the current generics design: https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#no-way-to-require-pointer-methods That is, there is no real "nice" way to do it. If you are willing to require a pointer receiver, you can

Re: [go-nuts] Generics: Self Referencing Constraint Types

2022-04-07 Thread jfcg...@gmail.com
> > If you are willing to require a pointer receiver, you can do constraint > type inference: > https://go.dev/play/p/L2NiAAM8qE4 > A single cast worked nicely , thank you. -- You received this message because you are subscribed to the Google Groups "golang

[go-nuts] Re: Java to Go converter - 2

2022-04-07 Thread alex-coder
Thanks for the comments about generating code to handle exceptions. . Here it is a new version. package main import ( "fmt" "os" ) type CatchException struct{} func main() { var args []string = os.Args var ce CatchException = CatchException{} ce.CatchException_main(args) }

[go-nuts] Re: [security] Go 1.18.1 and Go 1.17.9 pre-announcement

2022-04-07 Thread Carlos Amedee
Hello gophers, Due to an issue with release tooling, this release is now planned for Tuesday, April 12th. Sorry for the inconvenience. Carlos on behalf of the Go team On Monday, April 4, 2022 at 11:25:43 AM UTC-4 Julie Qiu wrote: > Hello gophers, > > We plan to issue Go 1.18.1 and Go 1.17.9 on

[go-nuts] why the opendefer optimization will close when my function's named return value escape

2022-04-07 Thread ワタナベハルキ
GOARCH="amd64" GOHOSTOS="linux" GOVERSION="go1.17.2" *Here is my test code* var sink *int func main(){ escape() } // named return value r func escape() (r int) { defer func(){ recover() }() sink = &r // escape r panic("qOeOp") return } jokoi@ubuntu:~/GoProJ/test

[go-nuts] Why does Go not have intrinsic functions?

2022-04-07 Thread Arthur Comte
Intrinsic functions (functions that compile down to one hardware instruction) are common in (relatively) low-level languages. Go even supports embed ASM (though a weird flavour of it) Can someone explain why we do not have an intrinsic function package? This seems like it would greatly ease the

[go-nuts] MaxDiskSize MaxLogCount for glog?

2022-04-07 Thread 'Jack Li' via golang-nuts
Hi group, I only find MaxSize in glog which sets the size of each log file.  Can glog support the options like how many disk size (ie. 10%, 1.8G, etc.) all the log files may use in total, and the count (ie. 10) of log files it can save. For example, logfile1.txt, logfile2.txt, ..., logfile10.

Re: [go-nuts] Why does Go not have intrinsic functions?

2022-04-07 Thread 'Axel Wagner' via golang-nuts
Go does have them. math/big compiles down to single instructions on platforms where it's supported. sync/atomic does as well. On Thu, Apr 7, 2022 at 8:03 PM Arthur Comte wrote: > Intrinsic functions (functions that compile down to one hardware > instruction) are common in (relatively) low-level

Re: [go-nuts] Why does Go not have intrinsic functions?

2022-04-07 Thread Ian Lance Taylor
On Thu, Apr 7, 2022 at 11:03 AM Arthur Comte wrote: > > Intrinsic functions (functions that compile down to one hardware instruction) > are common in (relatively) low-level languages. Go even supports embed ASM > (though a weird flavour of it) > Can someone explain why we do not have an intrinsi

[go-nuts] Missing /usr/lib/go/pkg/include/ for native binaries

2022-04-07 Thread Tong Sun
This might be the first go package that I do `go get` and which requires native binaries: $ go get -v go.opentelemetry.io/otel/exporters/stdout/stdouttrace golang.org/x/sys/unix # golang.org/x/sys/unix /.../Go/pkg/mod/golang.org/x/sys@v0.0.0-20210423185535-09eb48e85fd7/unix/asm_linux_amd64.s:9:

Re: [go-nuts] Missing /usr/lib/go/pkg/include/ for native binaries

2022-04-07 Thread Ian Lance Taylor
On Thu, Apr 7, 2022 at 2:35 PM Tong Sun wrote: > > This might be the first go package that I do `go get` and which requires > native binaries: > > $ go get -v go.opentelemetry.io/otel/exporters/stdout/stdouttrace > golang.org/x/sys/unix > # golang.org/x/sys/unix > /.../Go/pkg/mod/golang.org/x/sys

Re: [go-nuts] Why does Go not have intrinsic functions?

2022-04-07 Thread Sam Hughes
FWIW, I took a stab at a SIMD-oriented feature (https://go.dev/issue/48499), but as @Ian%20Lance%20Taylor put it, it's about the right approach. I skewed too far towards convenience in what I proposed, gaining significant maintainability concerns. On Thursday, April 7, 2022 at 3:35:35 PM UTC-5 I

Re: [go-nuts] Missing /usr/lib/go/pkg/include/ for native binaries

2022-04-07 Thread 'Jack Li' via golang-nuts
Yes, I download the latest go 1.18 installer for macOS from golang.google.cn. There's no problem with the installer from the official site. -- Original -- From: "Ian Lance Taylor"http://deb.debian.org/debian bullseye-backports/main amd64 Packages >  *** 1.17.6-1