Re: [go-nuts] Loop unit char entered

2024-03-05 Thread Michael Adamus
Daniel, I'd like to see source code for this if you're able. Thanks, Mike On Saturday, April 16, 2022 at 6:21:30 AM UTC-4 Daniel Jankins wrote: > Thank you, > That is what I did. It works very well. > Thank you again > > On Fri, Apr 15, 2022 at 8:48 PM Kurtis Rader wrote: > >> On Fri, Apr 15,

[go-nuts] Re: discrepancy between goal heap size and NextGC

2024-01-30 Thread 'Michael Knyszek' via golang-nuts
bserve that 799 MiB heap goal after 12 GCs have completed (your read of numgc), but you'll be reading that heap goal *during* the 13th GC cycle, which is what the GC trace is reporting on. On Tuesday, January 30, 2024 at 10:48:26 AM UTC-5 Michael Mitchell wrote: > Might it have someth

[go-nuts] Re: array index not starting at 0

2024-01-30 Thread 'Michael Knyszek' via golang-nuts
I see that you're on Windows. The clock granularity on Windows is really coarse (15 ms) because AFAIK there are no fast fine-grained OS-level clocks available. There are fine-grained clocks, but they're heavyweight. They're too heavyweight for many situations in the runtime, but honestly,

[go-nuts] Re: discrepancy between goal heap size and NextGC

2024-01-30 Thread Michael Mitchell
is the number of completed GC cycles, where a GC // cycle is sweep termination, mark, mark termination, and // sweep. This differs from memstats.numgc, which is // incremented at mark termination. cycles uint32 On Monday, January 29, 2024 at 7:12:53 AM UTC-5 Michael Mitchell wrote: > In the twelfth garb

Re: [go-nuts] Re: Passing 2d arrays from Go to C using runtime.Pinner

2024-01-29 Thread 'Michael Knyszek' via golang-nuts
restricting GC implementations in a way we don't want to. I filed https://github.com/golang/go/issues/65349 to track this. On Mon, Jan 29, 2024 at 11:17 AM peterGo wrote: > Michael, > > The OP appears to have lost interest in debugging. Here's my minimal, > reproducible example that produces th

[go-nuts] discrepancy between goal heap size and NextGC

2024-01-29 Thread Michael Mitchell
In the twelfth garbage collection of a short program I ran, GC trace reports the goal heap size as 735 MB (see below for gc11, gc12 and gc13 from GC trace) I also checked runtime Memstats (see attached image), and it says the nextGC target after 12 GCs have run is 838103616. Should goal Heap

[go-nuts] Re: Passing 2d arrays from Go to C using runtime.Pinner

2024-01-26 Thread 'Michael Knyszek' via golang-nuts
Ignoring more efficient ways to pass memory to C for a moment, superficially I do think your code using Pinner should work. Do you have a full reproducer? It's hard to tell from just looking at your code if your code is the problem, or its just enough to trigger some other cgo issue elsewhere

[go-nuts] pauseEnd times in runtime.Memstats

2024-01-12 Thread Michael Mitchell
In runtime.Memstates, one of the stats given is the timestamps for the last 256 garbage collections in the PauseEnd array, i.e. when those garbage collections took place. So if you subtract one timestamp from another, you can find out how much time took place between garbage collections. Is

[go-nuts] Re: garbage collections on Windows and Mac

2024-01-09 Thread 'Michael Knyszek' via golang-nuts
On Tuesday, January 9, 2024 at 10:21:26 PM UTC-5 Michael Mitchell wrote: Hi, I have noticed on my macbook pro that HeapInUse is always slightly above NextGC when the garbage collection occurs. According to mstats.go, the "garbage collector's goal is to keep HeapAlloc less than N

[go-nuts] garbage collections on Windows and Mac

2024-01-09 Thread Michael Mitchell
Hi, I have noticed on my macbook pro that HeapInUse is always slightly above NextGC when the garbage collection occurs. According to mstats.go, the "garbage collector's goal is to keep HeapAlloc less than NextGC" and also according to mstats.go, "HeapInUse minus HeapAlloc estimates the

[go-nuts] Re: Low memory utilization when using soft memory limit with GOGC=off

2023-12-06 Thread 'Michael Knyszek' via golang-nuts
On Tuesday, December 5, 2023 at 1:06:19 AM UTC-5 Zhihui Jiang wrote: Hi there, We are running a large scale recommendation system using Golang and we are working on some GC related improvement recently. One of the changes we are trying to apply is to use soft memory limit with GOGC=off as

Re: [go-nuts] Go/Python interop

2023-11-27 Thread 'Michael Knyszek' via golang-nuts
On Thu, Nov 23, 2023 at 11:52 AM Sebastien Binet wrote: > On Thu Nov 23, 2023 at 15:23 CET, 'Michael Knyszek' via golang-nuts wrote: > > Also, I'd like to clarify: > > > > - [David]: is it a good idea to use cgo for Go-Python interop? > > - [Michael]: no. better w

Re: [go-nuts] Go/Python interop

2023-11-23 Thread 'Michael Knyszek' via golang-nuts
Also, I'd like to clarify: - [David]: is it a good idea to use cgo for Go-Python interop? - [Michael]: no. better with pipe or RPC I'm wrong about this. A conversation after the meeting clarified a misunderstanding I had about Go->Python calls specifically. Both Go->Python and Pyth

Re: [go-nuts] Shrinking pprof data for PGO through quantization.

2023-11-09 Thread 'Michael Pratt' via golang-nuts
Hi Adam, Thanks for sending this, lots of interesting ideas here! I've been meaning for a long time to have more concrete guidelines for how much data collection is enough for good results, to include on https://go.dev/doc/pgo. I also think it would be valuable to provide tooling that can help

[go-nuts] Re: Why golang's garbage collector didn't free obj when an finalizer is associate with it?

2023-11-07 Thread 'Michael Knyszek' via golang-nuts
problem doesn't exist (unless I'm missing something of course). Nonetheless, the cycle still isn't collected. On Tuesday, November 7, 2023 at 3:51:58 AM UTC+1 Michael Knyszek wrote: Yes, cycles containing a finalizer aren't guaranteed to be freed. As others have pointed out, this is documented. Set

[go-nuts] Re: Why golang's garbage collector didn't free obj when an finalizer is associate with it?

2023-11-06 Thread 'Michael Knyszek' via golang-nuts
Yes, cycles containing a finalizer aren't guaranteed to be freed. As others have pointed out, this is documented. SetFinalizer is really designed for a narrow set of use-cases, so concessions were made for overall GC performance. This case is one of them. IIUC, the core problem is a

Re: [go-nuts] Suggestions on optimizing Go GC

2023-10-30 Thread 'Michael Knyszek' via golang-nuts
I second Jason's message, and +1 to off-heap memory as a last resort. Here are a few more details: For a starting point on how to reduce memory allocations directly, see https://go.dev/doc/gc-guide#Optimization_guide. Note that this may require restructuring your program in places. (e.g.

Re: [go-nuts] Question about runtime.Pinner

2023-10-12 Thread 'Michael Knyszek' via golang-nuts
On Thursday, October 12, 2023 at 9:55:12 AM UTC-4 Ian Lance Taylor wrote: On Thu, Oct 12, 2023 at 5:06 AM Pascal Costanza wrote: > > I have a question about runtime.Pinner: The documentation states that you can only pin an object when it’s the result of calling new, taking the address of

[go-nuts] Re: Question about runtime.Pinner

2023-10-12 Thread 'Michael Knyszek' via golang-nuts
On Thursday, October 12, 2023 at 8:07:02 AM UTC-4 Pascal Costanza wrote: Hi, I have a question about runtime.Pinner: The documentation states that you can only pin an object when it’s the result of calling new, taking the address of a composite literal, or taking the address of a local

[go-nuts] Re: go 1.21 tuned gc: what's it about?

2023-08-07 Thread 'Michael Knyszek' via golang-nuts
I saw this post a while back and forgot to reply; sorry about that. It's about this issue but also a little bit about this issue . Both of those problems can be summarized as the GC pacing itself for the

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

2023-08-03 Thread 'Michael Knyszek' via golang-nuts
That line (the full sentence is "The garbage collector now includes non-heap sources of garbage collector work (e.g., stack scanning) when determining how frequently to run.") is unrelated. It only refers to a change in accounting for what gets included in the GOGC calculation, not a change in

[go-nuts] Re: about "hybrid barrier"

2023-07-30 Thread 'Michael Knyszek' via golang-nuts
On Friday, July 28, 2023 at 8:05:03 AM UTC-4 metronome wrote: Hi, I came across two questions regarding the hybrid barrier that I am hoping someone can help with. 1. Chang https://go-review.googlesource.com/c/go/+/31765 says: *"It's unconditional for now because barriers on channel

[go-nuts] Re: Possible Go Compiler or Runtime bug?

2023-07-27 Thread 'Michael Knyszek' via golang-nuts
On Thursday, July 27, 2023 at 6:16:57 PM UTC-4 Michael Knyszek wrote: I believe this is working as intended, because I don't think the spec <https://go.dev/ref/spec#Conversions> makes any guarantees about the capacity of the slice you get back from a conversion. (Other than th

[go-nuts] Re: Possible Go Compiler or Runtime bug?

2023-07-27 Thread 'Michael Knyszek' via golang-nuts
The number 32 for the capacity comes from this constant , and the returned byte slice in that case is likely coming from a compiler-inserted call to stringtoslicebyte

[go-nuts] Docker container vscode debugging issue

2023-06-10 Thread Michael Odumosu
Greetings I am trying to debug an open source pacakge hashicorp vault from a docker container, I am using vscode remote debugging however its not stopping on any of the breakpoints. I tried changing the remote path according to this article but no luck, the reason I am debugging hashicorp

[go-nuts] ANN: ficta 1.0.0

2023-05-10 Thread Michael Ellis
I've just released ficta, a small project built using Francisco Escher's goopenai package. https://github.com/Michael-F-Ellis/ficta Ficta is a command line program that lets you use OpenAI's completion API from any text editor. Ficta exists because I found it frustrating to write short stories

Re: [go-nuts] Re: Looking for a specialized proxy package

2023-03-15 Thread Michael Ellis
at all and the > server can still request things in real time. > > Like: > https://www.talentica.com/blogs/part-3-building-a-bidirectional-streaming-grpc-service-using-golang/ > > On Wed, Mar 15, 2023, 6:35 PM Michael Ellis wrote: > >> FWIW, I pasted my post

[go-nuts] Re: Looking for a specialized proxy package

2023-03-15 Thread Michael Ellis
:48 PM UTC-4 Michael Ellis wrote: > I posted a question about this on ServerFault > <https://serverfault.com/questions/1125770/iot-http-multiplexing-through-cloud-host>last > > week but didn't get any answers other than a few comments from one person > who said (

[go-nuts] Looking for a specialized proxy package

2023-03-15 Thread Michael Ellis
I posted a question about this on ServerFault last week but didn't get any answers other than a few comments from one person who said (basically) "use a VPN". That seems like overkill. I'm trying to find

[go-nuts] Go 1.20 is released

2023-02-01 Thread 'Michael Knyszek' via golang-nuts
go1.20 is by using the go command: $ go install golang.org/dl/go1.20@latest $ go1.20 download To compile from source using a Git clone, update to the release with git checkout go1.20 and build as usual. Thanks to everyone who contributed to the release! Cheers, Michael, Matthew, and Dmitri for the Go

Re: [go-nuts] Create a 1GB ballast but it takes up RSS and pages are Dirty?

2022-11-16 Thread 'Michael Knyszek' via golang-nuts
On Wed, Nov 16, 2022 at 10:19 AM Jie Zhang wrote: > Actually, we used go1.16.5 before go1.19 released. Now we're consider > using go1.19 GOMEMLIMIT instead. > > But GOMEMLIMIT is a soft limit, if you deploy multiple services in the > same host (not per container per service), there will be

Re: [go-nuts] Create a 1GB ballast but it takes up RSS and pages are Dirty?

2022-11-10 Thread 'Michael Knyszek' via golang-nuts
That's correct. The runtime has a simple heuristic for avoiding zeroing but it's far from perfect. As a result, a ballast is inherently always going to be a little risky. This is especially true on some platforms, such as Windows, since there's no way to avoid marking the memory as committed

[go-nuts] Re: Facing issues while using builtin functions while executing golang templates

2022-10-20 Thread Michael Ellis
I did a quick search for "is not a defined function". That message appears once in https://go.dev/src/text/template/exec.go. It's triggered when findFunction() fails while executing a template. Hope that's of some use. On Wednesday, October 19, 2022 at 8:20:46 AM UTC-4 rit...@ext.dunzo.in

Re: [go-nuts] How long does it take to import packages?

2022-08-31 Thread 'Michael Pratt' via golang-nuts
Setting GODEBUG=inittrace=1 will log a trace of init function execution, which you can use to determine if init is slow, and if so which packages. e.g., `GODEBUG=inittrace=1 go version` ends with "init main @9.5 ms", indicating that it look 9.5ms to run all init functions. The format is

[go-nuts] Is there FIX exchange trading server or client simulator project with Go

2022-07-23 Thread 'michael yue' via golang-nuts
Is there FIX exchange trading server or client simulator project with Go -- 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

Re: [go-nuts] noinline is 25% faster than inline on apple m1 ?

2022-07-22 Thread 'Michael Pratt' via golang-nuts
I can reproduce similar behavior on linux-amd64: $ perf stat ./example.com.test -test.bench=BenchmarkInline -test.benchtime=1x goos: linux goarch: amd64 pkg: example.com cpu: Intel(R) Xeon(R) W-2135 CPU @ 3.70GHz BenchmarkInline-12 1 16.78 ns/op PASS

[go-nuts] Re: Go allocator: allocates arenas, reclaims pages?

2022-06-20 Thread 'Michael Knyszek' via golang-nuts
20, 2022 at 5:46:36 PM UTC-4 Michael Knyszek wrote: > Thanks for the question. The scavenger isn't as publicly visible as other > parts of the runtime. You've got it mostly right, but I'm going to repeat > some things you've already said to make it clear what's different. > > The Go

[go-nuts] Re: Go allocator: allocates arenas, reclaims pages?

2022-06-20 Thread 'Michael Knyszek' via golang-nuts
Thanks for the question. The scavenger isn't as publicly visible as other parts of the runtime. You've got it mostly right, but I'm going to repeat some things you've already said to make it clear what's different. The Go runtime maps new heap memory (specifically: a new virtual memory mapping

Re: [go-nuts] Crash within netpoll.go?

2022-06-08 Thread Michael Sweeney
at 4:55:47 PM UTC-7 Ian Lance Taylor wrote: > On Wed, Jun 8, 2022 at 4:21 PM Michael Sweeney wrote: > > > > Hi All, I searched around for details and references for a similar error > and could not find anything. I am posting here to see if someone has any > pointers to help

[go-nuts] Crash within netpoll.go?

2022-06-08 Thread Michael Sweeney
Hi All, I searched around for details and references for a similar error and could not find anything. I am posting here to see if someone has any pointers to help me discover the root cause. A GO 1.15.4 executable encountered a panic and generated a core file. Using 'dlv' to analyze the core

Re: [go-nuts] Re: Can’t view golang source when clicking on method name in a pkg.go.dev

2022-04-26 Thread 'Michael Pratt' via golang-nuts
This sounds like https://go.dev/issue/48956. In that case, it was some interference from an extension. On Tue, Apr 26, 2022 at 4:55 PM Ian Lance Taylor wrote: > On Tue, Apr 26, 2022 at 12:40 AM christoph...@gmail.com > wrote: > > > > This is a screen capture of what I see

Re: [go-nuts] Generics faster than native float64?

2022-04-19 Thread Michael Ellis
FWIW, no difference on my MacBook. (base) michaels-mbp copybench % go test -bench=. goos: darwin goarch: amd64 pkg: localgo/copybench cpu: Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz BenchmarkCopy-8 6999800 169.4 ns/op BenchmarkCopyG-86967590 170.6 ns/op PASS ok

Re: [go-nuts] encoding/json mistakenly transfer int64 format to string

2022-04-14 Thread Michael Ellis
@Brian That example is a superbly concise explanation go mod. Thanks! And I had no idea you could specify filenames and modules in the Playground. That's really useful! On Wednesday, April 13, 2022 at 3:11:54 AM UTC-4 Brian Candler wrote: > > I am a little bewildered by the new mod

Re: [go-nuts] Looked at using Go ... nil/SEGV really bothered me .. Go2 Proposal?

2022-03-25 Thread 'Michael Toy' via golang-nuts
u talk about something complex and important. I think I disagree with some statements, but even the disagreement is super helpful. Thanks for the discussion! -Michael Toy On Thursday, March 24, 2022 at 12:22:44 AM UTC-10 Brian Candler wrote: > The OP hasn't said specifically which languag

[go-nuts] Looked at using Go ... nil/SEGV really bothered me .. Go2 Proposal?

2022-03-23 Thread 'Michael Toy' via golang-nuts
I barely understand Go, so this is likely a stupid idea. Since Go uses nil for a lot of things, lots of things can be nil. I am not a huge fan of the null safe accessor. ( https://github.com/golang/go/issues/42847 ) I am a huge fan of the compiler telling me the places where I have not

[go-nuts] Constrain a type parameter to be assignable to another

2022-03-16 Thread Michael Andersen
to adhere to. The above code does not compile with 1.18 (cannot use a type parameter as constraint) I have a runtime check that works, but I'd love a compile time check. Is there a way to do that? Thanks Michael -- You received this message because you are subscribed to the Google Groups "g

Re: [go-nuts] Generic member of recursive struct

2021-12-20 Thread Michael Ellis
t; *HtmlNode[Something]]`. And the fact that there is no actual answer to what > "Something" would be should be a strong indicator for how much generics are > not what you want for this. > > On Mon, Dec 20, 2021 at 8:29 PM Axel Wagner > wrote: > >> >> >> On

Re: [go-nuts] Generic member of recursive struct

2021-12-20 Thread Michael Ellis
On Monday, December 20, 2021 at 1:33:49 PM UTC-5 ren...@ix.netcom.com wrote: > You should use interfaces and a “node” type. > Hmm, I tried type Node interface { string | []*HtmlTree } type HtmlTree struct { T string // html tagname, e.g. 'head' A string //

Re: [go-nuts] Generic member of recursive struct

2021-12-20 Thread Michael Ellis
case for generics, it's a use case for sum types > (which Go does not have). > > On Mon, Dec 20, 2021 at 4:11 PM Michael Ellis > wrote: > >> > They can't, sorry. >> Ok. Thanks, Axel. >> Saves me wasting more time. In the past 3 years of using Go, this is the

Re: [go-nuts] Generic member of recursive struct

2021-12-20 Thread Michael Ellis
> They can't, sorry. Ok. Thanks, Axel. Saves me wasting more time. In the past 3 years of using Go, this is the only use case where I've really wanted generics (other cases I've encountered so far are easily handled with code generation). -- You received this message because you are

[go-nuts] Generic member of recursive struct

2021-12-20 Thread Michael Ellis
I've got a package, github.com/Michael-F-Ellis/goht, that supports creating HTML docs in Go. It works well, for my purposes at least, but I've always been bothered by having to use []interface{} to define the struct member, C, that supports recursion. type HtmlTree struct { T

[go-nuts] Re: Do you have a minimal runnable go code that contain all key words in go?

2021-12-06 Thread Michael Ellis
Nice! Noticed it didn't have "new" so I changed the counter initializer in main() from var c = counter to p := new(counter) var c = *p https://go.dev/play/p/2vw4w44qSWm On Sunday, December 5, 2021 at 4:10:54 PM UTC-5 ben...@gmail.com wrote: > Not strictly "minimal" -- it uses

[go-nuts] Go 1.17.4 and Go 1.16.11 are released

2021-12-02 Thread Michael Knyszek
from source using a Git clone, update to the release with "git checkout go1.17.4" and build as usual. Thanks to everyone who contributed to the releases. Cheers, Michael, Heschi, Dmitri, and Carlos for the Go team -- You received this message because you are subscribed to the Google Group

Re: [go-nuts] Which error handling pattern do you prefer?

2021-11-12 Thread Michael Ellis
FWIW (which may not be much) I've settled on explicitly naming my return values in the function declaration. If the function returns include an error, I name always name it err. The general pattern is func foo() (v someType, err error) { err = doSomething() if err != nil { err =

Re: [go-nuts] initialization loop ?

2021-10-23 Thread Michael Ellis
> The rules for when an initialization loop occurs are part of the language spec: https://golang.org/ref/spec#Package_initialization. Thanks for the link. It helps with questions I've had recently about package initialization. Can you confirm that the statement "If a package has imports, the

[go-nuts] [security] Go 1.17.2 and Go 1.16.9 are released

2021-10-07 Thread Michael Knyszek
m the Go web site: https://golang.org/dl/ To compile from source using a Git clone, update to the release with "git checkout go1.17.2" and build as usual. Thanks to everyone who contributed to the releases. Cheers, Michael and Heschi for the Go team -- You received this message beca

Re: [go-nuts] Re: Questions about documentation of Go standard library

2021-10-07 Thread Michael Ellis
Kamil, Have you read https://go.dev/blog/errors-are-values by Rob Pike? Wrapping my head around the concept that an error is simply a value returned from a function was tremendously helpful when I had questions along the same lines as yours. -- You received this message because you are

Re: [go-nuts] Question on handling Data Race

2021-09-11 Thread Michael Dwyer
lem sufficiently? Have I missed any potential edge cases, that I have not thought through? I look forward to your reply. Thank you for your time and patience ... THANX(MKD). On Saturday, September 11, 2021 at 8:42:36 PM UTC-4 Kurtis Rader wrote: > On Sat, Sep 11, 2021 at 5:01 PM Michael

[go-nuts] Question on handling Data Race

2021-09-11 Thread Michael Dwyer
Presently working on a Data Race and have some questions on how to proceed. The code example is a hypothetical mock up of the actual code under review, but is a fair representation. The struct used by both functions is named Foo. In the hypothetical, SomeFunc() reads variable from foo.bar,

Re: [go-nuts] Two consecutive reads from a buffered channel results in deadlock

2021-09-04 Thread Michael Dwyer
helpful hints and documentation, so others can learn. Greatly appreciate your time an assistance. THANX(MKD). On Saturday, September 4, 2021 at 9:31:32 PM UTC-4 Kurtis Rader wrote: > On Sat, Sep 4, 2021 at 5:55 PM Michael Dwyer wrote: > >> I encountered a deadlock when reading fro

[go-nuts] Two consecutive reads from a buffered channel results in deadlock

2021-09-04 Thread Michael Dwyer
I encountered a deadlock when reading from a buffered channel. The deadlock occurs when an attempt is made to read from the channel twice, without an intermediate write to the channel. The problematic code is as follows: func main() { myInt := 432 readerChan := make(chan int, 3) for forI

[go-nuts] Re: Printing a slice of structs recursively

2021-09-02 Thread Michael Ellis
Here's one way. https://goplay.space/#5KzrUc0171N On Thursday, September 2, 2021 at 1:03:48 AM UTC-4 seank...@gmail.com wrote: > Try doing it recursively, passing in both the current parent id and > indentation level > > On Thursday, September 2, 2021 at 3:55:01 AM UTC+2 n.erde...@gmail.com >

Re: [go-nuts] Makefiles for Go Programs

2021-08-23 Thread Michael Ellis
Three cheers for mage . It's more verbose than make but it's pure Go. I use it to build and test projects that include generated html/css/js supported by a Web Assembly clients communicating with a server. On Monday, August 23, 2021 at 7:33:10 PM UTC-4 Connor Kuehl

[go-nuts] Go 1.17 is released

2021-08-16 Thread Michael Knyszek
is by using the go command: $ go get golang.org/dl/go1.17 $ go1.17 download To compile from source using a Git clone, update to the release with "git checkout go1.17" and build as usual. Thanks to everyone who contributed to the release! Cheers, Michael and Dmitri for the Go Team -- Yo

[go-nuts] GOOS=js/GOARCH=wasm

2021-07-27 Thread W. Michael Petullo
I have been building applications using the GOOS=js/GOARCH=wasm for around two years. I really like being able to write both client and server code in Go. I have four questions that I have not yet found a clear answer for: (1) The syscall/js package is marked EXPERIMENTAL. Is there any

Re: [go-nuts] Go and GPUs

2021-06-25 Thread Michael Poole
f I were going to spend the time on this, I would probably target SPIR-V with Vulkan or OpenCL for portability rather than Nvidia's PTX or Apple's Metal. AMD, Nvidia and Google (Android) all have good support for SPIR-V through their Vulkan stacks, and there are third-party Vulkan layers that r

Re: [go-nuts] How to cast a multi-value?

2021-05-18 Thread 'Marc Michael' via golang-nuts
s still using additional variables, but they are hidden inside the > helper function. > On Sunday, May 16, 2021 at 8:07:24 PM UTC-7 Kurtis Rader wrote: > >> On Sun, May 16, 2021 at 7:49 PM 'Marc Michael' via golang-nuts < >> golan...@googlegroups.com> wrote: >> >&

[go-nuts] How to cast a multi-value?

2021-05-16 Thread 'Marc Michael' via golang-nuts
Hello, as Go provides multi values I would expect that's possible to cast such a multi value. Do I see it correctly, that Go does not provide it? Example: os.ReadFile returns []byte, error. I want to cast the []byte to a string. content, err := os.ReadFile(path) Is it possible to cast the

Re: [go-nuts] Syscalls that take structs with embedded pointers

2021-05-14 Thread 'Michael Pratt' via golang-nuts
sure that's not a bug? What's to stop the *Byte from being > moved by the GC? > > On Fri, May 14, 2021 at 2:27 PM Michael Pratt wrote: > > > > You can use a *byte for the buffer. For instance, unix.Iovec does this: > https://pkg.go.dev/golang.org/x/sys/unix#Iovec

Re: [go-nuts] Syscalls that take structs with embedded pointers

2021-05-14 Thread 'Michael Pratt' via golang-nuts
You can use a *byte for the buffer. For instance, unix.Iovec does this: https://pkg.go.dev/golang.org/x/sys/unix#Iovec Users can cast a *unix.Iovec directly to unsafe.Pointer for Syscall without any special handling of the *byte field. On Fri, May 14, 2021, 09:01 sh...@tigera.io wrote: > Now,

Re: [go-nuts] TotalAlloc dropped in runtime/metrics

2021-04-29 Thread 'Michael Knyszek' via golang-nuts
Hi Marco, https://go-review.googlesource.com/c/go/+/312431 just landed and should resolve the issue for Go 1.17. On Tue, Apr 20, 2021 at 3:28 PM Michael Knyszek wrote: > Oh, actually, you can compute Mallocs and Frees from allocs-by-size and > frees-by-size (summing the total # of samples

Re: [go-nuts] Re: How to do vdso calls in my own code?

2021-04-27 Thread 'Michael Pratt' via golang-nuts
Oops, I should say the syscall package could do this. x/sys/unix has the extra complexity of not being tied to a Go release. On Tue, Apr 27, 2021, 12:53 Michael Pratt wrote: > I'm not sure if calling through the VDSO is the best solution to this > specific issue, though it does soun

Re: [go-nuts] Re: How to do vdso calls in my own code?

2021-04-27 Thread 'Michael Pratt' via golang-nuts
I'm not sure if calling through the VDSO is the best solution to this specific issue, though it does sound like a case that would certainly benefit. Regardless, one fairly clean way we could support this would be to make x/sys/unix.ClockGettime (and Gettimeofday) call through the VDSO rather than

Re: [go-nuts] TotalAlloc dropped in runtime/metrics

2021-04-20 Thread 'Michael Knyszek' via golang-nuts
Oh, actually, you can compute Mallocs and Frees from allocs-by-size and frees-by-size (summing the total # of samples). You can only estimate TotalAlloc though, which is genuinely missing. On Tue, Apr 20, 2021 at 3:14 PM Michael Knyszek wrote: > Oh gosh, I think TotalAlloc, Mallocs, and Fr

Re: [go-nuts] TotalAlloc dropped in runtime/metrics

2021-04-20 Thread 'Michael Knyszek' via golang-nuts
Oh gosh, I think TotalAlloc, Mallocs, and Frees are actually an oversight on my part. Sorry about that. They're very easy to add and I can probably even add them for this release. Please do use the new runtime/metrics package! Most of the other metrics should be there in some form (e.g. the

Re: [go-nuts] Why does Go ignore HTTP_PROXY and HTTPS_PROXY if the proxy address is localhost

2021-04-14 Thread Michael Baker
On 14/04/2021 20:25, Jeff Peck wrote: Just a complete shot in the dark. Have you verified that the environment variables you set are indeed getting picked up inside of your application? Try checking the output of os.GetEnv("HTTP_PROXY"), os.GetEnv("HTTPS_PROXY"), and os.GetEnv("NO_PROXY").

Re: [go-nuts] Modules... why it has to be so painfull?

2021-04-09 Thread Michael Ellis
he replace statement in tbflash's go.mod file, i.e., replace github.com/Michael-F-Ellis/tbchrom v1.0.0 => /Users/mellis/localgo/tbchrom localgo ├── go.mod ├── mypkg │ └── pkg.go ├── myprog │ └── main.go ├── tbchrom │ ├── .git │ ├── .gitignore │ ├── .vscode │ ├── go.mod │ ├── g

Re: [go-nuts] Re: [golang-dev] Go 1.16.3 and Go 1.15.11 are released

2021-04-02 Thread 'Michael Pratt' via golang-nuts
mgcsweepbuf.go was deleted in 1.16, so it seems you still have files from 1.15 sitting around in /usr/local/go/. On Fri, Apr 2, 2021 at 4:13 AM Jan Mercl <0xj...@gmail.com> wrote: > On Thu, Apr 1, 2021 at 11:52 PM Dmitri Shuralyov > wrote: > > > We have just released Go versions 1.16.3 and

Re: [go-nuts] string matching

2021-04-01 Thread Michael Poole
} } As you can see, the regular expression-based solution suggested by others leads to less code. This input string is so short that CPU usage will be negligible for most purposes, outweighed by graceful error handling and code maintenance concerns. Best regards, Michael On Thu, Apr 1,

Re: [go-nuts] Finding error type for `errors.As` and `errors.Is`

2021-04-01 Thread 'Michael Schaller' via golang-nuts
types and values in the error chain would be a worthwhile addition to Go's `errors` package. On Wednesday, March 31, 2021 at 7:33:32 PM UTC+2 rog wrote: > On Wed, 31 Mar 2021 at 18:05, 'Michael Schaller' via golang-nuts < > golan...@googlegroups.com> wrote: > >> Hi everyone, &g

[go-nuts] golang/mobile: Could we add GitHub Actions for PRs?

2021-03-22 Thread Michael Chong
GitHub Actions has been introduced for a while. For PRs of go-mobile , only *google-cla *is running on GitHub Actions. I wonder whether we can add support like automatic testing? -- You received this message

[go-nuts] Re: encoding/html package to generate html markup programmatically

2021-03-15 Thread Michael Ellis
goht <https://github.com/Michael-F-Ellis/goht> might be what you're looking for. On Sunday, March 14, 2021 at 7:36:52 PM UTC-4 atd...@gmail.com wrote: > Hi, > > I am currently thinking about implementing SSR for a Go client-side > framework. > Not only that but I

Re: [go-nuts] Modules and internal packages

2021-03-04 Thread Michael Ellis
suggestion (thx!), I added an Init section to the magefile to walk the project tree changing any import references to match the new repo before building the app for the first time. Thanks again for the help and explanations. On Thursday, March 4, 2021 at 11:46:49 AM UTC-5 Michael Ellis wrote

Re: [go-nuts] Modules and internal packages

2021-03-04 Thread Michael Ellis
On Thursday, March 4, 2021 at 11:01:06 AM UTC-5 axel.wa...@googlemail.com wrote: > On Thu, Mar 4, 2021 at 4:51 PM Michael Ellis wrote: > >> My bad. I should have tested before writing that. Thanks for checking. >> Good to know the tools are enforcing the distinction.

Re: [go-nuts] Modules and internal packages

2021-03-04 Thread Michael Ellis
On Thursday, March 4, 2021 at 10:06:01 AM UTC-5 Bryan C. Mills wrote: > > I would argue that the “hack” in this case is the approach of defining the > API in terms of copying in an entire tree of packages, rather than having > users of the API make function calls into a specific set of

Re: [go-nuts] Modules and internal packages

2021-03-04 Thread Michael Ellis
On Thursday, March 4, 2021 at 10:14:03 AM UTC-5 axel.wa...@googlemail.com wrote: > On Thu, Mar 4, 2021 at 3:54 PM Michael Ellis wrote: > >> Not sure if my case is all that special. Seems like the requirement for >> a full path to an internal package breaks the concept of

Re: [go-nuts] Modules and internal packages

2021-03-04 Thread Michael Ellis
On Thursday, March 4, 2021 at 2:24:11 AM UTC-5 axel.wa...@googlemail.com wrote: > On Thu, Mar 4, 2021 at 12:55 AM Michael Ellis > wrote: > >> Thanks even though it's not the answer I was hoping for. Seems to me >> that since the Go Authors have accorded special status

Re: [go-nuts] Modules and internal packages

2021-03-03 Thread Michael Ellis
On Wednesday, March 3, 2021 at 6:11:38 PM UTC-5 axel.wa...@googlemail.com wrote: > On Thu, Mar 4, 2021 at 12:02 AM Michael Ellis > wrote: > >> What's the right way to handle this use case? >> > > I think the right way to handle it is to modify the file. In the fin

[go-nuts] Modules and internal packages

2021-03-03 Thread Michael Ellis
ready to publish). Today I decided to clone it and start an actual project. I've run into a problem with internal package imports. Briefly, the skeleton has multiple source files that import from internal packages, e.g. import "github.com/Michael-F-Ellis/skeleton/internal/c

[go-nuts] Added polish translation of Tour of Go

2021-03-03 Thread Michael
Hi! I've been recently working on a translation of "A Tour of Go" to Polish language and wanted to let you know that I have a PR ready! Kind regards Michal Stokluska -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

Re: [go-nuts] Error handling

2021-02-25 Thread Michael MacInnis
> this. > > What I'm wondering is are there cases that the compiler won't catch and is > this likely to stop working in some future release where, in a block of > code like the one above, the compiler will decide that the function doesn't > need to escape to the heap? > &g

Re: [go-nuts] Error handling

2021-02-20 Thread Michael MacInnis
rther if that pattern can be implemented as a library/package with acceptable trade offs. Michael. On Saturday, February 20, 2021 at 6:54:39 PM UTC-5 ohir wrote: > Dnia 2021-02-20, o godz. 13:21:09 > Michael Ellis napisał(a): > > > FWIW, I've put together a tiny package that, with som

Re: [go-nuts] Error handling

2021-02-20 Thread Michael MacInnis
ng problem outline I realized that I did not have the ability to add additional error handling actions. I added Chain a few days after my original post. Michael. On Saturday, February 20, 2021 at 4:21:10 PM UTC-5 michael...@gmail.com wrote: > FWIW, I've put together a tiny package that, wit

Re: [go-nuts] Error handling

2021-02-20 Thread Michael Ellis
FWIW, I've put together a tiny package that, with some tradeoffs, seems useful for reducing boilerplate in the common case where a function simply wants to return an error to its caller. https://github.com/Michael-F-Ellis/ro The code is almost trivial. It consists of two small functions

Re: [go-nuts] Error handling

2021-02-18 Thread Michael MacInnis
If others would like to take a look the code is here: https://github.com/michaelmacinnis/handle I'm particularly interested in any problems I may have overlooked and similar packages that may exist but that I haven't stumbled across. Thanks, Michael. On Thursday, February 18, 2021 at

Re: [go-nuts] Error handling

2021-02-15 Thread Michael MacInnis
dering if there are other interactions that I've overlooked. It is these more mechanism than policy considerations where I'm looking for feedback. Michael. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and s

Re: [go-nuts] What compatibility of go/ast, go/types, go/packages packages is planned, if any, when transitioning toward go2 ?

2021-02-14 Thread Michael Ellis
On Wednesday, 27 January 2021 at 23:28:17 UTC+1 Ian Lance Taylor wrote: To be clear, there is no Go 2, and there are no plans for Go 2. Speaking as one who suffered through the ill-conceived and interminable Python3 transition, this is the best news I've heard since discovering and falling in

Re: [go-nuts] Re: How to get VSCode to use different Go env vars for different directories in the same repo?

2021-02-14 Thread Michael Ellis
I've opened https://github.com/golang/vscode-go/issues/1225. -- 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

Re: [go-nuts] Re: How to get VSCode to use different Go env vars for different directories in the same repo?

2021-02-14 Thread Michael Ellis
"+build mage" for magefiles. Cheers, Mike *“I want you to act as if the house was on fire. Because it is.” — Greta Thunberg* On Sun, Feb 14, 2021 at 11:32 AM Wojciech S. Czarnecki wrote: > Dnia 2021-02-14, o godz. 10:54:02 > Michael Ellis napisał(a): > > > I wr

Re: [go-nuts] Re: How to get VSCode to use different Go env vars for different directories in the same repo?

2021-02-14 Thread Michael Ellis
t;, > } > } > in there. > 3. In future, work in two instances of VS Code, even though if logically > it's a different parts of same project and could be under the same Go > module. All IDE features will work fluently. I haven't seen any problems > with this appr

  1   2   3   4   5   6   7   8   9   >