Re: [go-nuts] I saw the news today, oh boy

2025-05-15 Thread Ian Lance Taylor
On Wed, May 14, 2025 at 9:28 PM Tanawatra Chantaranit wrote: > > May I ask if there will be any further developments on Generics in gofrontend > going forward? I hope so. But no guarantees. But let me ask in turn: why do you care? What are you using gofrontend for? Ian -- You received this m

Re: [go-nuts] net/icmp: Echo.ID and Echo.Seq are defined as int, but Marshal converts them to uint16

2025-05-11 Thread Ian Lance Taylor
On Sun, May 11, 2025 at 8:59 AM Yuen Sun wrote: > > I believe changing the types of ID and Seq to uint16 would make the > implementation more consistent with the ICMP protocol specification. > Understanding the original design intent would also help the community better > align with Go's design

Re: [go-nuts] How timers rely on netpoll?

2025-05-10 Thread Ian Lance Taylor
On Tue, Apr 1, 2025 at 10:24 AM GoStriver wrote: > > > I noticed that the source code mentions in many places that timers depend on > netpoll. However, I understand that timers are triggered via > pp.timers.check() within findRunnable(). How exactly do timers rely on > netpoll then? Am I missin

Re: [go-nuts] Potential language feature for testing value membership in if statements?

2025-03-19 Thread Ian Lance Taylor
On Wed, Mar 19, 2025 at 10:43 AM Mike Schinkel wrote: > > Given these benchmark results, would the Go team reconsider such a language > feature on a basis of performance vs. a comparison of syntax to bring if > statement performance closer to that of switch statements? The current > disparity m

Re: [go-nuts] appropriate way to call fcntl(2) from Go on darwin?

2025-03-18 Thread Ian Lance Taylor
On Tue, Mar 18, 2025 at 12:08 AM Jason E. Aten wrote: > > I'm porting some C code that does manual filesystem "extent" > file space management from Linux to Darwin (and into Go). > > The Linux fallocate() call and its FALLOC_FL_INSERT_RANGE > operation are not directly available on Darwin, but sug

Re: [go-nuts] Potential language feature for testing value membership in if statements?

2025-03-18 Thread Ian Lance Taylor
On Tue, Mar 18, 2025 at 4:51 PM Mike Schinkel wrote: > > While working on a parser, I've repeatedly encountered patterns like: > >if c == ' ' || c == '\t' { /* handle whitespace */ } >if token == EOL || token == EOF { /* handle end markers */ } >if lexer.Type == TextLine || lexer.Type

Re: [go-nuts] appropriate way to call fcntl(2) from Go on darwin?

2025-03-18 Thread Ian Lance Taylor
On Tue, Mar 18, 2025 at 8:28 AM Jason E. Aten wrote: > Thank you so much, Ian. > > On Tuesday, March 18, 2025 at 2:21:37 PM UTC Ian Lance Taylor wrote: > > Or in this case it seems simpler to just use the unix.FcntlFstore > function which already exists and does the right thin

Re: [go-nuts] Making Go More Accessible to Non-English Speakers

2025-03-16 Thread Ian Lance Taylor
On Sun, Mar 16, 2025 at 3:31 PM Jayathra Abeywarna wrote: > > I’m exploring ways to make programming more accessible to people who don’t > speak English or use the Latin script. Right now, most programming languages > use English-based keywords and Latin characters, which can make it harder for

Re: [go-nuts] go-contrib-init error message

2025-03-10 Thread Ian Lance Taylor
On Mon, Mar 10, 2025 at 2:54 AM Patrick wrote: > > > > > go-contrib-init has a -repo option. In this case you should run > > "go-contrib-init -repo=tools". > > > Thank you, Ian. > > This gives me (with -repo=text) > > $ go-contrib-init -repo=text > The repo you want to work on is currently not on

Re: [go-nuts] go-contrib-init error message

2025-03-07 Thread Ian Lance Taylor
On Fri, Mar 7, 2025 at 12:03 AM Patrick wrote: > > I'd like to contribute to https://go.googlesource.com/text. So I cloned the > directory and ran (after registering and logging in) > > go-contrib-init > > and the resulting message is: > > Current directory's git was cloned from "https://go.googl

Re: [go-nuts] go get - no package to get in current directory

2025-03-06 Thread Ian Lance Taylor
On Wed, Mar 5, 2025 at 10:34 PM Björn Försterling wrote: > > when trying to "go get" inside the "golang/tools" module (golang.org/x/tools) > I cannot download any Go files: > .../golang/tools (master) $ GOMODCACHE="$(pwd)/.godeps" go get > go: no package to get in current directory Well, that is

Re: [go-nuts] How to Sync Geth from the Latest Finalized Block with a Checkpoint-Synced Prysm Beacon Node

2025-03-04 Thread Ian Lance Taylor
On Tue, Mar 4, 2025 at 6:07 AM SEMIA GUESMI wrote: > I have a question about the Execution Client (Geth) and the Consensus > Client (Prysm). > > I synced the beacon node from a checkpoint and started the execution > client with --syncmode full. > > My question is: *Will the execution client also

Re: [go-nuts] CGO Threads and Memory Not Being Released in Go

2025-03-04 Thread Ian Lance Taylor
On Tue, Mar 4, 2025 at 11:32 AM David Bell wrote: > > Why is memory increasing indefinitely with CGO? Because when the Go scheduler creates threads, it keeps them around, on the theory that if they were needed once, they will be needed again. Certainly we wouldn't want all threads to exit as soon

Re: [go-nuts] Google Contributor Licence Agreement web form problems

2025-02-28 Thread Ian Lance Taylor
On Fri, Feb 28, 2025 at 12:16 PM Rory Campbell-Lange wrote: > > The CLA form at > https://cla.developers.google.com/clas/new?domain=DOMAIN_GOOGLE&kind=KIND_INDIVIDUAL > is erroring for me with the following error: > > "A server error occurred, please try your request again". > > The error has pe

Re: [go-nuts] suggested change to template.Funcs docstring

2025-02-28 Thread Ian Lance Taylor
On Fri, Feb 28, 2025 at 12:19 PM Rory Campbell-Lange wrote: > > On 27/02/25, Rory Campbell-Lange (r...@campbell-lange.net) wrote: > > On 27/02/25, Ian Lance Taylor (i...@golang.org) wrote: > > > On Thu, Feb 27, 2025 at 1:04 PM Rory Campbell-Lange > > > wrote: > &

Re: [go-nuts] Why can't single-method interfaces not be implemented by embedding?

2025-02-27 Thread Ian Lance Taylor
On Thu, Feb 27, 2025 at 9:49 AM cpu...@gmail.com wrote: > > Thanks Ian, you are of course correct- but I still don't get it. Thank you > for taking the time. > > > m.EqualName has to mean something. The Go language defines it as > meaning the field in m's type, rather than the embedded method. >

Re: [go-nuts] suggested change to template.Funcs docstring

2025-02-27 Thread Ian Lance Taylor
On Thu, Feb 27, 2025 at 1:04 PM Rory Campbell-Lange wrote: > > The docstring for [html|text]/template.Funcs is as follows > > package template // import "html/template" > > func (t *Template) Funcs(funcMap FuncMap) *Template > Funcs adds the elements of the argument map to the temp

Re: [go-nuts] Why can't single-method interfaces not be implemented by embedding?

2025-02-27 Thread Ian Lance Taylor
On Thu, Feb 27, 2025 at 9:32 AM cpu...@gmail.com wrote: > > I can see that that's the difference and cause but I'm not convinced by the > explanation (although that clearly is what happens): > > If the embedded method name EqualName shadows the method name EqualName that > should still implement

Re: [go-nuts] [security] golang Firestore SIGSEGV

2025-02-27 Thread Ian Lance Taylor
On Thu, Feb 27, 2025 at 9:22 AM David wrote: > > ___ > # go run sigsegv.go > panic: runtime error: invalid memory address or nil pointer dereference > [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa68a44] > > goroutine 1 [running]: > cloud.google.com/go

Re: [go-nuts] Re: Exposing newcoro/coroswitch

2025-02-26 Thread Ian Lance Taylor
On Wed, Feb 26, 2025 at 2:18 AM Nuno Cruces wrote: > > On Tuesday 25 February 2025 at 18:15:40 UTC Ian Lance Taylor wrote: > > I think what you're presenting is an argument for > > package iter > > // Push returns an iterator, a yield function, and a stop function.

Re: [go-nuts] Re: Exposing newcoro/coroswitch

2025-02-25 Thread Ian Lance Taylor
o the lifespan of a single function. In the original example, the values to push into the sequence would come from a method call. This can all be done already with channels, of course, as shown by the earlier examples. Ian >> On Tuesday, February 25, 2025 at 6:15:40 PM UTC Ian Lance Taylor w

Re: [go-nuts] Re: Exposing newcoro/coroswitch

2025-02-25 Thread Ian Lance Taylor
On Tue, Feb 25, 2025 at 6:17 AM Nuno Cruces wrote: > > I wanted a solution that doesn't necessarily involve goroutines and channels, > for the same reason that iter.Pull was created: because goroutines and > channels add unnecessary parallelism that has the potential to introduce data > races,

Re: [go-nuts] Cancelled context error not propagated in net/cgo_unix.go

2025-02-24 Thread Ian Lance Taylor
there wouldOn Mon, Feb 24, 2025 at 12:35 PM 'Paul Ruane' via golang-nuts wrote: > > I hit a problem today whereby a gRPC call did not come back with a status of > cancelled, despite the request context being cancelled. > > Tracing it through I found that it was because of a failed DNS lookup and

Re: [go-nuts] Custom build tags with third-party libraries

2025-02-20 Thread Ian Lance Taylor
Message- > From: Ian Lance Taylor > Sent: Wednesday, February 19, 2025 5:36 PM > To: Bushnell, Thomas > Cc: golang-nuts@googlegroups.com > Subject: Re: [go-nuts] Custom build tags with third-party libraries > > This message was sent by an external party. > > > O

Re: [go-nuts] Custom build tags with third-party libraries

2025-02-19 Thread Ian Lance Taylor
On Wed, Feb 19, 2025 at 9:36 AM 'Bushnell, Thomas' via golang-nuts wrote: > > The module https://github.com/confluentinc/confluent-kafka-go takes advantage > of a custom build tag to change its behavior. (Specifically, the “dynamic” > build tag forces it to use a dynamic shared library -lrdkafka

Re: [go-nuts] runtime.AddCleanup and C struct hierarchies: cleanup order?

2025-02-19 Thread Ian Lance Taylor
On Wed, Feb 19, 2025 at 1:12 PM twp...@gmail.com wrote: > > The documentation for runtime.AddCleanup says: > > > There is no specified order in which cleanups will run. > > Given the following types: > > type Parent struct { > parentResource int > } > > type Child struct { > parent *Parent

Re: [go-nuts] input directly from cli after a function

2025-02-13 Thread Ian Lance Taylor
On Thu, Feb 13, 2025 at 2:12 PM Jabari Zakiya wrote: > > I want to input an integer directly after the function > > $ ./myfunction n (CR) > > not > > $ ./myfunction (CR) > n (CR) > > None of my search results explains how to do this. Sounds like you want to look at os.Args, which will contai

Re: [go-nuts] Unused unexported methods kept by DCE when using plugins

2025-02-11 Thread Ian Lance Taylor
On Tue, Feb 11, 2025 at 1:57 AM Pierre Gimalac wrote: > > But in that case why would that only happen for dynamic builds ? > Shouldn't all unexported methods also be kept for the "normal" build ? In a normal build the linker can see all the code in the program, so it knows whether something is po

Re: [go-nuts] Unused unexported methods kept by DCE when using plugins

2025-02-07 Thread Ian Lance Taylor
On Fri, Feb 7, 2025 at 2:59 PM 'Pierre Gimalac' via golang-nuts wrote: > > I noticed that when importing the std "plugin" package then (some ?) > unexported methods are kept in the binary. > > Disclaimer it's something I only observed on a complex binary, I could not > make a minimal reproducibl

Re: [go-nuts] Fscan() eats 1st char in scanning values

2025-01-26 Thread Ian Lance Taylor
On Sun, Jan 26, 2025 at 4:51 PM 'Ivan Burak' via golang-nuts wrote: > > Fscan() eats 1st char in scanning values if the values aren't a first value > in a line. > > The documentation tells: "Fscanln is similar to Fscan, but stops scanning at > a newline and after the final item there must be a n

Re: [go-nuts] Go 1.24 runtime.Cleanup and sync.Pool.

2025-01-21 Thread Ian Lance Taylor
On Tue, Jan 21, 2025 at 6:10 PM John wrote: > > Curious if the new runtime.Cleanup() would allow auto sync.Pool.Put() for a > variable. I'm not sure from the documentation if this would work or would > cause some type of issue (the variable was on its way to collection and then > gets put in a

Re: [go-nuts] inconsistent min max signatures with variadics

2025-01-20 Thread Ian Lance Taylor
On Mon, Jan 20, 2025 at 11:35 AM 'Dan Kortschak' via golang-nuts wrote: > > On Mon, 2025-01-20 at 10:42 -0800, Ian Lance Taylor wrote: > > Calling append with an empty slice is well defined. Calling min or > > max with an empty slice is not. > > If the only inp

Re: [go-nuts] inconsistent min max signatures with variadics

2025-01-20 Thread Ian Lance Taylor
On Mon, Jan 20, 2025 at 7:00 AM Benoît Marguerie wrote: > > Even if the spec precises : > > slice arguments are not permitted > > I wonder if there's any real technical reason to prohibit the use of the > slice variadics during min/max buildin functions, when it's allowed with > append (which cr

Re: [go-nuts] SIGSEGV: segmentation violation with go test -race

2025-01-15 Thread Ian Lance Taylor
On Wed, Jan 15, 2025 at 6:49 PM John wrote: > > I'm running into a fault now when trying to run `go test -race`/ > > I get the same when I disable CGO (because it lists a CGO signal in the > fault): > `CGO_ENABLED=0 go test -c -race` > > I've attempted to build a binary out of it and run it, with

Re: [go-nuts] question about net Buffers.WriteTo method

2025-01-15 Thread Ian Lance Taylor
On Wed, Jan 15, 2025 at 4:07 AM Jamil Djadala wrote: > > As i understand, WriteTo is used to optimize write of multiple buffers > to socket, using writev. But writev also ensure that these multiple > buffers are written atomically, in case of concurrent writes, bytes > from concurrent write are n

Re: [go-nuts] Allow relaxed type casting on more general assignments?

2025-01-14 Thread Ian Lance Taylor
On Tue, Jan 14, 2025 at 8:10 PM Mike Schinkel wrote: > > P.S. If I instead asked that all funcs in the standard library accepting > strings be converted to use that generic signature, I assume that would be a > non-starter for performance reasons, right? We couldn't change the standard library

Re: [go-nuts] Allow relaxed type casting on more general assignments?

2025-01-14 Thread Ian Lance Taylor
On Tue, Jan 14, 2025 at 4:19 PM Mike Schinkel wrote: > > Given this I am now pondering why it would not be possible and acceptable it > Go could allow relaxing of the need to type cast — on an opt-in basis — when > going from a derived time to its base type? There is a related discussion in htt

Re: [go-nuts] Re: Getting new coverage output format from go test -cover

2025-01-11 Thread Ian Lance Taylor
On Sat, Jan 11, 2025 at 10:07 AM Paul Chesnais (papacharlie) wrote: > > Is there another forum I can ask about this? Should this be a feature request > against the go team directly? It seems strange that the formats haven't been > converged, or that there's no way to get the new binary format fr

Re: [go-nuts] Security implications of exposed Go runtime anon pipes

2025-01-09 Thread Ian Lance Taylor
On Thu, Jan 9, 2025 at 10:22 AM Moritz Sanft wrote: > > Thanks for your swift response. Let me clarify some things that I didn't seem > to convey well in my initial question. > > Probably the most important; I'm not looking to disclose a vulnerability in > Go here. If I was to disclose that, I w

Re: [go-nuts] Security implications of exposed Go runtime anon pipes

2025-01-09 Thread Ian Lance Taylor
On Thu, Jan 9, 2025 at 9:16 AM Moritz Sanft wrote: > > I've recently came across a Go application with an arbitrary file write > vulnerability restricted to `/proc/self`. After researching for a little, > I've found the following article which exploits such a vulnerability in a > NodeJS applica

Re: [go-nuts] "go-import" is great, we need "go-delete"

2025-01-08 Thread Ian Lance Taylor
On Wed, Jan 8, 2025 at 4:19 PM Jeffery Carr wrote: > > We can 'git clone' anything into the namespace at compile time. But you can only do that if the git repository is still available. > I assumed the proxy system was intended to make things elegant, fast and > simple, not so much some magic

Re: [go-nuts] Unexpected behavior where panic raised in-between two phases of an assignment statement

2024-12-28 Thread Ian Lance Taylor
On Sat, Dec 28, 2024 at 5:38 PM Kaiming Yang wrote: > > I'm trying to understand execution order of assignment statement, as spec > mentioned: > > > The assignment proceeds in two phases. First, the operands of index > > expressions and pointer indirections (including implicit pointer > > indir

Re: [go-nuts] How to export internal runtime functions using go:linkname to bypass linkname checks in Go 1.23?

2024-12-26 Thread Ian Lance Taylor
On Wed, Dec 25, 2024 at 10:34 PM zhengyao xie wrote: > > I would like to ask everyone for your help. In external code, I used > `//go:linkname` directive as follows: > > ```go > //go:linkname runtime_setEventErr runtime.(*pollDesc).setEventErr > func runtime_setEventErr(pd runtimePollDesc, b bool

Re: [go-nuts] using runtime cgo.Handle passing chan type

2024-12-23 Thread Ian Lance Taylor
On Mon, Dec 23, 2024 at 8:29 AM 'Red' via golang-nuts wrote: > > I need to use CGO to call a C function in a Go program, where the parameter > type is a void pointer. Now I need to pass a struct to the C function, and > the struct contains a channel. Additionally, I have a Go callback function

Re: [go-nuts] Scalar Replacement of Aggregates (SROA)

2024-12-02 Thread Ian Lance Taylor
On Sat, Nov 30, 2024 at 7:37 PM Pepper Lebeck-Jobe wrote: > > Summary: Would we be open to adding SROA as a compiler optimization to the go > compiler? > > I recently discovered via this rathole that SROA is something that Clang does > for the programming languages which compile with it. The imp

Re: [go-nuts] Issue with CGO and GOGC when dealing with large buffers

2024-12-02 Thread Ian Lance Taylor
On Mon, Dec 2, 2024 at 11:16 AM Jason E. Aten wrote: > > ChatGPT seems to think that the go-wolfssl library is not following proper > CGO rules in > many places. The transcript below is long. I post it nonetheless, in case > such > analysis is new for readers. I would suggest that you (everyone

Re: [go-nuts] Issue with CGO and GOGC when dealing with large buffers

2024-12-02 Thread Ian Lance Taylor
On Mon, Dec 2, 2024 at 9:32 AM Lealem Amedie wrote: > > I’m trying to get an https server working by overwriting the > accept/read/write methods in the http module. I’m using go-wolfssl for TLS. > > The server will accept a TLS 1.2 connection, then send some random data to > the client connects,

Re: [go-nuts] Is it possible to compile a Go program without jump tables ?

2024-11-28 Thread Ian Lance Taylor
On Thu, Nov 28, 2024, 1:13 AM 'Karolina GORNA' via golang-nuts < golang-nuts@googlegroups.com> wrote: > > @Ian, ok I understand thank you. I am working on Go binary analysis and > this feature would help a lot. Out of curiosity, why do you want to do binary analysis on a program if you can ask f

Re: [go-nuts] Is it possible to compile a Go program without jump tables ?

2024-11-27 Thread Ian Lance Taylor
On Wed, Nov 27, 2024 at 5:48 AM 'Karolina GORNA' via golang-nuts wrote: > > I wondered if there is a similar command to gcc -fno-jump-tables -o > output_file source_file.c to compile Go code without jump tables but only > with if/else statements (binary search) please ? Sorry, there is no such

Re: [go-nuts] query for runtime.reportZombies data race PoC code

2024-11-20 Thread Ian Lance Taylor
On Tue, Nov 19, 2024 at 3:50 AM Lin Lin wrote: > > Thanks for your kind and instant reply. > > Allow me to explain myself a bit more. > > My code has two kinds of data races. First one is a global struct without any > pointer member being written and read by multiple Goroutines. Second one is a

Re: [go-nuts] Non pointer constraint for generic func

2024-11-13 Thread Ian Lance Taylor
On Wed, Nov 13, 2024 at 1:28 PM ben...@gmail.com wrote: > > > Personally I mostly think that is OK. One of the guidelines that Go > > follows is to encourage people to write code rather than write types. > > To me this falls into writing types. > > > I'm intrigued by this concept, but I don't real

Re: [go-nuts] Non pointer constraint for generic func

2024-11-13 Thread Ian Lance Taylor
On Wed, Nov 13, 2024 at 8:59 AM Elad Gavra wrote: > > I would like to create a non-pointer constraint for a generic function. > For example: > ``` > func F[T NonPtr](p T) { > // do something with p > } > ``` > Such that > ``` > F(MyStruct{}) // allowed > F(&MyStruct{}) // disallowed, compile time

Re: [go-nuts] Re: runtime/pprof - pausing CPU profiling

2024-11-13 Thread Ian Lance Taylor
On Wed, Nov 13, 2024, 5:31 AM Jason E. Aten wrote: > All good. I still think that the hack of blocking and restoring the > runtime's SIGPROF signal > handler might actually work though. It might not work. But if it does, it > is almost > exactly what you were looking for. > > Ian or others more

Re: [go-nuts] cmd.ExtraFiles == nil, yet process inherits FDs?

2024-11-11 Thread Ian Lance Taylor
Files slot to nil, rather then the field itself left > as nil. > > On Friday 8 November 2024 at 19:03:43 UTC Ian Lance Taylor wrote: >> >> On Fri, Nov 8, 2024 at 2:18 AM Peter Galbavy wrote: >> > >> > I have a command line manager tool that builds the starting

Re: [go-nuts] Do we need to drain a closed channel ?

2024-11-11 Thread Ian Lance Taylor
n > On Friday, March 1, 2024 at 11:34:55 PM UTC+9 Ian Lance Taylor wrote: >> >> On Fri, Mar 1, 2024 at 6:26 AM Shubha Acharya >> wrote: >> > >> > I have been working with buffered channels. I have stumbled upon a >> > scenario where buffered channe

Re: [go-nuts] cmd.ExtraFiles == nil, yet process inherits FDs?

2024-11-08 Thread Ian Lance Taylor
On Fri, Nov 8, 2024 at 2:18 AM Peter Galbavy wrote: > > I have a command line manager tool that builds the starting environment for a > process and calls cmd.Start(). > > The code sets (doesn't need to as it starts as nil, but does to be extra > explicit) cmd.ExtraFiles = nil, but even then I se

Re: [go-nuts] Re: ANN: gocov, a Go coverage testing tool

2024-11-08 Thread Ian Lance Taylor
On Fri, Nov 8, 2024 at 9:13 AM 'N Hess' via golang-nuts wrote: > > gocov 1.2.1 has a bug that makes it report lower module coverages - we had to > revert to 1.1.0. Too bad the repo is closed and read-only now. > > I can provide a way to reproduce if needed. N You are replying to a message that i

Re: [go-nuts] atomic variables?

2024-11-07 Thread Ian Lance Taylor
On Thu, Nov 7, 2024 at 2:54 PM Roger wrote: > > True or false, it's better to avoid loading atomic variables unnecessarily? Questions like this always depend on the context. There is no answer that is always correct in all situations. That said, all else being equal, it's better to avoid loadin

Re: [go-nuts] Generic type alias with type conversion

2024-11-04 Thread Ian Lance Taylor
On Mon, Nov 4, 2024 at 2:40 AM hey...@gmail.com wrote: > > Does that mean it's currently not possible to conditionally implement a > method based on type parameters? I think that is https://go.dev/issue/65394. Ian > On Monday, November 4, 2024 at 1:47:30 PM UTC+8 Ian L

Re: [go-nuts] Generic type alias with type conversion

2024-11-03 Thread Ian Lance Taylor
On Sun, Nov 3, 2024 at 12:41 AM hey...@gmail.com wrote: > > Not sure generic type alias is the solution, but what I'm trying to do is I > have a type like this > > type Map[K comparable, V any] struct { m map[K]V } > > and I want it to implement json.Unmarshaller to decode json objects, when K's

Re: [go-nuts] Forced GC every 4 minutes

2024-11-01 Thread Ian Lance Taylor
On Fri, Nov 1, 2024 at 9:15 PM Siyuan Liu wrote: > > There is this strange behavior on a Golang service we are running. > > On some instances, there is a forced GC that gets triggered every 4 minutes. > This can be observed when the `GODEBUG=gctrace=1` is turned on. There is a > log line with `g

Re: [go-nuts] /usr/local/go/pkg/tool/linux_arm/link: running gcc failed: exit status 1

2024-11-01 Thread Ian Lance Taylor
On Fri, Nov 1, 2024 at 11:08 AM Stephan Lukits wrote: > > from my research I found it could be helpful to exectue gcc with the > `--mfloat-abi=hard` option; but I couldn't figure how to inject that option? I don't know whether it will fix your problem, but you can set the environment variable CG

Re: [go-nuts] Returning a pointer or value struct.

2024-10-31 Thread Ian Lance Taylor
On Thu, Oct 31, 2024 at 6:24 AM Tushar Rawat wrote: > > I have seen few places where functions are returning struct as a value (for > instance time package, time is always returned as a value) and however at > some places folks prefer to return the pointers to struct instead of the copy. > > Whi

Re: [go-nuts] Re: Check Channel is active or not while Writing as writer Go routine

2024-10-31 Thread Ian Lance Taylor
On Thu, Oct 31, 2024 at 5:29 AM 'Aniket Pandey' via golang-nuts wrote: > > while performing trial and error i just implemented an idea of not closing > the channel in my go-lang code , due to which my server memory was going > high , sharing it just FYI I don't know what happened in your progr

Re: [go-nuts] Understanding SyscallN for windows when doing windows api call

2024-10-25 Thread Ian Lance Taylor
On Fri, Oct 25, 2024 at 8:34 AM rudeus greyrat wrote: > > In cpp (and other LLVM based languages), the windows API function address is > taken from the DLL after it has been loaded in the Virtual Memory space (or > at least something like that). > > In go, everything is wrapped around that Sysca

Re: [go-nuts] Unintuitive error message for external modules that lack a go.mod

2024-10-22 Thread Ian Lance Taylor
On Tue, Oct 22, 2024 at 8:39 AM rojiu wrote: > > I ran into this error when trying to create a module with a single Go file > and import it from GitHub: > > ``` > predeclared any requires go1.18 or later (-lang was set to go1.16; check > go.mod) > ``` > > After some digging, I learned that since

Re: [go-nuts] Re: Why there is no net.ListenContext?

2024-10-20 Thread Ian Lance Taylor
On Thu, Dec 21, 2023 at 1:11 AM Michał Matczuk wrote: > > net.ListenConfig does not document the context usage. The docs just point to > Listen. I'd expect that cancelling the context would stop the listener but > it's not the case. > > The questions are: > > * Should Listener created with net.L

Re: [go-nuts] Are there plans to make coroutines a supported feature?

2024-10-20 Thread Ian Lance Taylor
On Sun, Oct 20, 2024 at 4:54 PM Mike Schilling wrote: > > If so,is it likely. to look more like the current small API, of the larger > one discussed in Russ Cox's Coroutines for Go? There are no plans for this at present. Ian -- You received this message because you are subscribed to the Goog

Re: [go-nuts] Unused parameter in the golang.org/x/net/internal/socks worth removing or not?

2024-10-20 Thread Ian Lance Taylor
On Sun, Oct 20, 2024 at 12:15 PM Himanshu Balurkar wrote: > > https://github.com/golang/net/blob/5716b9813d2c78aa3bb6e08160517facfb2e84e6/internal/socks/socks.go#L233-L245 > > At the above link, the address string argument in the validateTarget function > is not used anywhere. Unclear why the par

Re: [go-nuts] Modifying go toolchain to have an empty IAT for windows amd64

2024-10-19 Thread Ian Lance Taylor
On Sat, Oct 19, 2024 at 8:11 PM rudeus greyrat wrote: > > I want to have an empty IAT when I compile go exe. Why do you want that? > I noticed that all the imports in the IAT are because of a file in go runtime > package called > https://github.com/golang/go/blob/master/src/runtime/os_windows

Re: [go-nuts] Generic constant type parameters?

2024-10-16 Thread Ian Lance Taylor
024, at 8:09 AM, Ian Lance Taylor wrote: > > > > On Tue, Oct 15, 2024 at 10:18 PM Robert Engels wrote: > >> > >> Hmm, I thought I had it “working” using this code > >> https://go.dev/play/p/pzKacmi3aPe but there is a compiler error, but > >> a

Re: [go-nuts] Generic constant type parameters?

2024-10-16 Thread Ian Lance Taylor
On Tue, Oct 15, 2024 at 10:18 PM Robert Engels wrote: > > Hmm, I thought I had it “working” using this code > https://go.dev/play/p/pzKacmi3aPe but there is a compiler error, but > according to the accepted proposal documentation this should be valid > https://go.googlesource.com/proposal/+/ref

Re: [go-nuts] Generic constant type parameters?

2024-10-15 Thread Ian Lance Taylor
On Tue, Oct 15, 2024 at 5:01 PM 'Robert Engels' via golang-nuts wrote: > > Is there someway of doing this with Go generics? > https://github.com/robaho/cpp_fixed/blob/6770b217acd84e4b723449e4c4bb42c92e7f2af1/fixed.h#L18-L23 Not at present, sorry. Ian -- You received this message because you a

Re: [go-nuts] for mystery

2024-10-12 Thread Ian Lance Taylor
ll have different truth values. Consider "(1 << 32) == 0". Ian > On Oct 12, 2024, at 10:04 AM, Ian Lance Taylor wrote: > >  > On Fri, Oct 11, 2024, 9:30 PM Robert Engels wrote: >> >> FWIW, I’m not sure that I think it is the best outcome. If the expressio

Re: [go-nuts] for mystery

2024-10-12 Thread Ian Lance Taylor
On Fri, Oct 11, 2024, 9:30 PM Robert Engels wrote: > FWIW, I’m not sure that I think it is the best outcome. If the expression > is a constant the loop can be omitted entirely - which I would hope the > compiler would do. And consequently the errors from the compiler should > reflect that - inclu

Re: [go-nuts] for mystery

2024-10-11 Thread Ian Lance Taylor
On Fri, Oct 11, 2024 at 3:07 PM robert engels wrote: > > true is an expression, the compiler doesn’t inspect that it is a constant > expression, thus you need the return statement The exact rules can be seen at https://go.dev/ref/spec#Terminating_statements. Ian > > On Oct 11, 2024, at 4:57

Re: [go-nuts] Are there alternatives to lower & upper bound or partition_point

2024-10-10 Thread Ian Lance Taylor
On Thu, Oct 10, 2024 at 2:01 PM 'lijh8' via golang-nuts wrote: > > Are there alternatives to lower & upper bound or partition_point > > Suppose there duplicate entries in a slice. > I need to use a loop to find out the upper bound on a sorted slice. > > Are there something similar to c++ lower_bou

Re: [go-nuts] Why isn't the memory model part of the spec?

2024-10-10 Thread Ian Lance Taylor
On Wed, Oct 9, 2024 at 11:30 PM will@gmail.com wrote: > > It seems required to understand how Go programs work. > > If the memory model was never written, or is omitted from an implementation, > would the concurrency features still be reliable and useful? People were able to write concurrent

Re: [go-nuts] good practice or premature optimization

2024-10-09 Thread Ian Lance Taylor
On Wed, Oct 9, 2024 at 8:51 PM Nico Braun wrote: > > Hi, recently I became very self aware of potential performance implications > my code might have. > > In go there are a few key concepts, like escape analysis and bound checks. If > you check the standard library, you can see it was coded with

Re: [go-nuts] Re: Using structs, pointers, and maps

2024-10-07 Thread Ian Lance Taylor
On Mon, Oct 7, 2024 at 10:29 AM Ken Lee wrote: > > --- > There is a consideration to make, though: historically it has been considered > bad form in Go to give a type a mix of value and pointer receivers in methods > without a very specific reason for doing so. > --- > > Is this still the case n

Re: [go-nuts] Profiling the `go` tool itself?

2024-10-02 Thread Ian Lance Taylor
graph is very large, but tens of minutes is an unreasonable length of time. How long are your go.mod and go.sum files? Have you run "go mod tidy"? Ian > On Thursday 3 October 2024 at 00:21:30 UTC+7 Ian Lance Taylor wrote: >> >> On Wed, Oct 2, 2024 at 10:11 AM opennota wro

Re: [go-nuts] Profiling the `go` tool itself?

2024-10-02 Thread Ian Lance Taylor
On Wed, Oct 2, 2024 at 10:11 AM opennota wrote: > > Cold-start builds are slow af on my machine (think tens of minutes), and have > been like that since around Go 1.20. (See also maybe related > https://github.com/golang/go/issues/38939). Is there a way to profile `go > build` to determine why

Re: [go-nuts] suggestions regarding contribution

2024-09-26 Thread Ian Lance Taylor
On Fri, Sep 20, 2024 at 5:22 AM Vinayak Rastogi wrote: > > I’m eager to contribute to the "Oscar" project on Googlesource. I have a > solid grasp of Go, including structs, interfaces, and have built a web > server, Discord bot, and cache system. I’m currently learning microservices, > logging,

Re: [go-nuts] go test cache: include umask as a test input for caching?

2024-09-17 Thread Ian Lance Taylor
On Tue, Sep 17, 2024 at 4:08 AM twp...@gmail.com wrote: > > However, I want to make go test cache's behavior more correct for a case > where it is currently incorrect for no measurable performance penalty. What > are the reasons for *not* doing this? We do not want to record all aspects of the

Re: [go-nuts] go test cache: include umask as a test input for caching?

2024-09-17 Thread Ian Lance Taylor
On Tue, Sep 17, 2024 at 3:26 AM twp...@gmail.com wrote: > > > Should work, AIUI, even with the issues you mention. Or is there something > > else going on that I'm unaware of? > > The problem is not running the tests. The problem is that the test cache is > not invalidated correctly. We are sug

Re: [go-nuts] go test cache: include umask as a test input for caching?

2024-09-13 Thread Ian Lance Taylor
On Fri, Sep 13, 2024 at 3:03 PM twp...@gmail.com wrote: > > tl;dr: umask is a system-wide global that affects go tests and should be > considered when validating go test's cache. > > > Motivation: > > I'm the author of a popular open source project that writes files to the > user's home director

Re: [go-nuts] Can a golang program be compiled to run with only ONE goroutine ?

2024-09-10 Thread Ian Lance Taylor
On Tue, Sep 10, 2024 at 6:54 AM 'Karolina GORNA' via golang-nuts wrote: > > Maybe the question has already been asked, but I would be glad to have your > feedback. > > Can a golang program be compiled to run with only one goroutine, or at least > one "OS thread" ? > > I am aware of using GOMAXPR

Re: [go-nuts] Re: Question about adding new feature to go (FreeBSD/netlink) and compliation

2024-09-06 Thread Ian Lance Taylor
On Fri, Sep 6, 2024 at 7:42 AM Martin Stiemerling wrote: > > I just wanted to get back to this and probably ask somebody out of the go > core team, if you guys have recently used the mkall.sh script under > src/syscall for freebsd/amd64? No, we haven't. The syscall package is all-but-frozen.

Re: [go-nuts] Question about adding new feature to go (FreeBSD/netlink) and compliation

2024-09-03 Thread Ian Lance Taylor
On Tue, Sep 3, 2024 at 10:07 AM Martin Stiemerling wrote: > > > > > Am 03.09.2024 um 18:50 schrieb Ian Lance Taylor : > > > > On Tue, Sep 3, 2024 at 9:03 AM Martin Stiemerling > > wrote: > >> > >> FreeBSD has since a while also support for the

Re: [go-nuts] Question about adding new feature to go (FreeBSD/netlink) and compliation

2024-09-03 Thread Ian Lance Taylor
On Tue, Sep 3, 2024 at 9:03 AM Martin Stiemerling wrote: > > FreeBSD has since a while also support for the netlink facility, similar to > Linux. For Linux there is support in go via the syscall pkg for working with > Linux's netlink, but not yet for FreeBSD > > I have started to add the FreeBSD

Re: [go-nuts] Suppress GoFmt-generated error with/tools.go?

2024-09-02 Thread Ian Lance Taylor
On Sun, Sep 1, 2024 at 1:08 AM Mike Schinkel wrote: > > Ian — if you are reading this — does this rise enough to the level of a bug — > checking imports on a `go fmt` — that I should submit as an issue on GitHub? This is, perhaps unfortunately, expected behavior. The "go fmt" command is the "fm

Re: [go-nuts] Iterators

2024-09-02 Thread Ian Lance Taylor
On Mon, Sep 2, 2024 at 4:36 PM vignes waran wrote: > > I have been trying to understand the concept of iterators introduced in the > new Go 1.23 release, but I’m struggling to comprehend how the iteration call > happens multiple times and where the boolean value for stopping the loop is > obtai

Re: [go-nuts] Concatenate iterators

2024-08-30 Thread Ian Lance Taylor
On Fri, Aug 30, 2024 at 10:33 AM costin wrote: > > Is there a way to concatenate 2 iterators (other than writing my own > function)? There isn't any std function I could find. Would such a function > belong in the iter package (slices seems like the wrong place)? It would probably start out in

Re: [go-nuts] Dialer and Named Services: clarification

2024-08-28 Thread Ian Lance Taylor
On Wed, Aug 28, 2024 at 6:08 AM Yinebeb Tariku wrote: > > I've been diving into the Go standard library's net package and have some > questions about the Dialer function and named services. > > 1. Where exactly does Go perform the mapping between a service name (e.g., > "http") and its correspon

Re: [go-nuts] documentation for dlog output

2024-08-27 Thread Ian Lance Taylor
On Tue, Aug 27, 2024 at 11:32 AM Michael Mitchell wrote: > > At the end of dlog trace, we get the following. > These seem like basic assembly instructions with addresses but I have no idea > what any of it means, and I can't find any documentation for it. Can someone > take the time to go throu

Re: [go-nuts] Connectivity breakage from removal of TLS RSA KEX from default encryption suite

2024-08-27 Thread Ian Lance Taylor
On Mon, Aug 26, 2024 at 10:16 PM Robert Engels wrote: > > Hmm. Aren’t the endpoints supposed to negotiate the available cryptographic > methods? > > So wouldn’t this affect non Go endpoints as well - which puts the burden back > on the side trying to use the latest Go version which is removing s

Re: [go-nuts] Connectivity breakage from removal of TLS RSA KEX from default encryption suite

2024-08-26 Thread Ian Lance Taylor
t. Ian > > On Aug 26, 2024, at 4:45 PM, Ian Lance Taylor wrote: > > > > On Mon, Aug 26, 2024 at 2:28 PM robert engels wrote: > >> > >> Isn’t the version release notes > >> shttps://pkg.go.dev/net/http#Request.Hostufficient? Maybe add a "breaking

Re: [go-nuts] Connectivity breakage from removal of TLS RSA KEX from default encryption suite

2024-08-26 Thread Ian Lance Taylor
equences of the change. We want to make it as easy as possible for the user of the program to close that gap. Ian > > On Aug 26, 2024, at 4:20 PM, Ian Lance Taylor wrote: > > > > On Mon, Aug 26, 2024 at 8:31 AM Creaky wrote: > >> > >> Want to discuss the im

Re: [go-nuts] Connectivity breakage from removal of TLS RSA KEX from default encryption suite

2024-08-26 Thread Ian Lance Taylor
On Mon, Aug 26, 2024 at 8:31 AM Creaky wrote: > > Want to discuss the impacts from the implementation of the proposal > crypto/tls: disable RSA key exchange cipher suites by default #63413 and > possible ways forward beyond go change some code (whilst it may fix the issue > in the short term, h

Re: [go-nuts] [compilation|gob] Is it possible to have multiple gob encoding instances?

2024-08-24 Thread Ian Lance Taylor
On Sat, Aug 24, 2024 at 2:51 AM gavraz wrote: > > 1. I attempted to wrap gob with my own package and specify a distinct > toolchain, hoping it would result in a fully independent copy of the gob > package in the compiled code. Thanks for the clarification, this approach is > a no-go. > 2. The c

  1   2   3   4   5   6   7   8   9   10   >