[go-nuts] Re: Any option to substitute plug-in package ?

2023-08-02 Thread alex-coder
Hi All, so, binary code plugin as a RPC - frankly, never thought about :-) What is written in go spec is a >> dynamically discovering and loading *shared lib* as I see it but community developed much further Thank you. среда, 2 августа 2023 г. в 15:03:38 UTC+3, TheDiveO: > It really depends

[go-nuts] Re: Maybe a Bug? The Go compiler stores a stack pointer into a global object

2023-08-02 Thread Qingwei Li
I notice that Go1.17.7 still allocates the array on heap by calling newobject while Go1.18 allocates the array on stack. I also notice that in the release note of Go1.18 that "The garbage collector now includes non-heap sources of garbage collector work". Does the GC in 1.18 and following versi

Re: [go-nuts] Re: Amateur's questions about "Go lang spec"

2023-08-02 Thread Patrick Smith
Actually, this example is a bit unfortunate. Depending on the implementation of append, the capacity of s3 may be small enough that a new buffer must be allocated for s4, which means there is no need to test for overlaps. https://go.dev/play/p/n5FNqlA0DaS demonstrates that this is what happens in t

Re: [go-nuts] Re: Amateur's questions about "Go lang spec"

2023-08-02 Thread 'Axel Wagner' via golang-nuts
You're not missing anything. The example is correct and helpful. It's also something that can be tested out, for definite confirmation . On Wed, Aug 2, 2023 at 9:57 PM Brian Candler wrote: > s3 == []int{0, 0, 2, 3, 5, 7, 0, 0} > > Therefore, > s3[3:6] is {3, 5,

[go-nuts] Re: Maybe a Bug? The Go compiler stores a stack pointer into a global object

2023-08-02 Thread 'Keith Randall' via golang-nuts
Yes, that looks very, very wrong. It looks like this issue goes back to at least 1.16. If you can open an issue at https://github.com/golang/go/issues we can investigate. On Wednesday, August 2, 2023 at 10:03:31 AM UTC-7 Jinbao Chen wrote: > I use go1.20.5 to compile the following code. > pack

[go-nuts] Re: failed fuzz tests not reproducible when re-run

2023-08-02 Thread William Rehwinkel
Dear Jochen, If you open font/tounicode2/testdata/fuzz/FuzzToUnicode/2566873a28045c1b (or whatever appears after "Failing input written to")The file should contain the exact values passed to the test. It will look a bit like this go test fuzz v1 string(".") string("0") This might give you a h

[go-nuts] Re: failed fuzz tests not reproducible when re-run

2023-08-02 Thread William Rehwinkel
Sorry, should have written this in the first email. I think another thing I would do to debug is fmt.Printf as many relevant variables as you can think of to see if any of them don't look right, but only make this happen when you have a failed test (where you would t.Fail()). -William On Wedne

[go-nuts] The double caret statement

2023-08-02 Thread Wojciech S. Czarnecki
The double caret statement aka "erret" or "bat return") ad-hoc specification. "^^" (erret) statement specify the conditional execution of a following terminating statement, the condition being a built-in check whether any of the function F named result parameter of interface type _error_ is not

Re: [go-nuts] Error handling

2023-08-02 Thread Wojciech S. Czarnecki
Dnia 2023-07-29, o godz. 22:57:15 DrGo napisał(a): > This involves introducing a new keyword "orelse" that is a syntactic sugar > for an "if err!=nil" block. You can implement it as a snippet under any editor in use today. If your goal is to personally have it in just one line, you can turn of

Re: [go-nuts] Re: Amateur's questions about "Go lang spec"

2023-08-02 Thread Brian Candler
s3 == []int{0, 0, 2, 3, 5, 7, 0, 0} Therefore, s3[3:6] is {3, 5, 7} // from index 3 up to but not including 6 s3[2:] is {2, 3, 5, 7, 0, 0} // from index 2 to end Unless I'm missing something? On Wednesday, 2 August 2023 at 17:59:06 UTC+1 Kamil Ziemian wrote: > Hello, > > First, as I probably

Re: [go-nuts] Error handling

2023-08-02 Thread TheDiveO
Sorry to f'up on myself, but I would like to add regarding #1: at least my personal impression is that for #1 it looks very difficult to improve this in any meaningful way. It looks to me as if #2 is actually where the improvements would bear large fruit as it makes Go more welcoming and produc

Re: [go-nuts] Error handling

2023-08-02 Thread TheDiveO
Ben Hoyt's blog post Scripting with Go: a 400-line Git client that... mentions error handling from a perspective that made me clear for the first time why I'm always in two minds when it comes to Go's error handling: 1. the perspective of a prod-code pa

[go-nuts] Maybe a Bug? The Go compiler stores a stack pointer into a global object

2023-08-02 Thread Jinbao Chen
I use go1.20.5 to compile the following code. package main func use(...interface{}) { } func main() { testCases := [...][][]int{ {{42}}, {{1, 2}}, {{3, 4, 5}}, {{}}, {{1, 2}, {3, 4, 5}, {}, {7}}, } for _, testCase := range testCases {

[go-nuts] Go 1.21 Release Candidate 4 is released

2023-08-02 Thread announce
Hello gophers, We have just released go1.21rc4, a release candidate version of Go 1.21. It is cut from release-branch.go1.21 at the revision tagged go1.21rc4. Please try your production load tests and unit tests with the new version. Your help testing these pre-release versions is invaluable. Re

Re: [go-nuts] Re: Amateur's questions about "Go lang spec"

2023-08-02 Thread Kamil Ziemian
Hello, First, as I probably end my first reading of Go Spec in coming days, I want to thank you all for helping me in that. Thank you. :) Second, I have question about example shown in section "Appending to and copying slices". s0 := []int{0, 0} s1 := append(s0, 2)// append a s

Re: [go-nuts] Error handling

2023-08-02 Thread DrGo
Fair enough … I understand that people have different styles On Wednesday, August 2, 2023 at 12:54:20 AM UTC-6 Brian Candler wrote: > FWIW, I'm in the "I like how it is now better than any other proposal so > far" camp; I think this happens as you get used to the Go way. Go is Go. > > The only

[go-nuts] Re: Any option to substitute plug-in package ?

2023-08-02 Thread TheDiveO
It really depends on what you want to achieve... 1. dynamically discovering *out-of-process* RPC plugins ... Hashicorp's might be the most famous one. 2. dynamically discovering and loading *shared lib *plugins ... this needs some plumbing above the pure stdlib plugin functionality.

[go-nuts] Re: I made a CLI tool, and I'm curious about your ideas

2023-08-02 Thread TheDiveO
Fresh from the Go project itself. *Experimenting with project templates:* https://go.dev/blog/gonew On Friday, July 14, 2023 at 10:05:34 AM UTC+2 Marcello H wrote: > No matter what other people say, as a first project, I think it is great > because it gives you the opportunity to practise how

[go-nuts] Re: Any option to substitute plug-in package ?

2023-08-02 Thread Brian Candler
The plugin package is very limiting even under Linux: see this reddit post . I suggest you look at hashicorp's go-plugin

[go-nuts] Any option to substitute plug-in package ?

2023-08-02 Thread alex-coder
Hi All ! Plug-in package is very interesting, but in case the development under windows it does not work, So, any hint to use some option instead will be highly appreciated. Thank you. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscr