Re: [go-nuts] Re: help with thread limit

2024-02-01 Thread Steve Roth
ensible number? > > On Thu, 1 Feb 2024 at 16:08, Steve Roth wrote: > >> Thanks to the people who suggested how to limit the number of apparent >> cores. Unfortunately, doing that didn't solve the problem. I have the >> number of cores now limited to two — confirmed by

[go-nuts] Re: help with thread limit

2024-02-01 Thread Steve Roth
, and crashing when cgroups won't let it. Surely there must be some way to get a Go program to run successfully in an environment with process limits? Any further suggestions would be greatly appreciated. Regards, Steve On Wed, Jan 31, 2024 at 6:43 PM Steve Roth wrote: > I am running Go cod

[go-nuts] help with thread limit

2024-01-31 Thread Steve Roth
I am running Go code on a shared web hosting server from a major hosting company. Using cgroups, they limit the number of threads any user can create to 25. Up until a week ago, they had me running on a server with 24 cores, and everything worked fine. Now they've moved me to a new server with 1

[go-nuts] Re: error handling thoughts

2023-07-27 Thread Steve Roth
orward. Thanks, all, for the responses. Steve On Thu, Jul 27, 2023 at 8:03 AM Steve Roth wrote: > The ongoing Go survey asked a question about satisfaction with error > handling in Go. I'd like to express an opinion on it that I haven't seen > elsewhere, for which there was

[go-nuts] error handling thoughts

2023-07-27 Thread Steve Roth
The ongoing Go survey asked a question about satisfaction with error handling in Go. I'd like to express an opinion on it that I haven't seen elsewhere, for which there was not room in the survey. I am generally a fan of the explicit error handling code in Go, but I get frustrated by the interact

Re: [go-nuts] workspace question

2022-10-12 Thread Steve Roth
.@gmail.com> wrote: > On Wed, Oct 12, 2022 at 4:49 AM Steve Roth wrote: > > > > I'd appreciate help with setting up a workspace, involving two modules > that exist only on my local disk and not in any SCM. I understand how to > create the workspace and use both modules

[go-nuts] workspace question

2022-10-11 Thread Steve Roth
I'd appreciate help with setting up a workspace, involving two modules that exist only on my local disk and not in any SCM. I understand how to create the workspace and use both modules in it. What I can't figure out is how to add a dependency from mod1 to mod2 in mod1's go.mod file. The support

Re: [go-nuts] profiling help

2022-01-12 Thread Steve Roth
is%20to,requests%20per%20unit%20of%20time.> > in that situation. > > On Wed, Jan 12, 2022 at 4:41 PM Steve Roth wrote: > >> Hi, Robert, >> >> The request *should* be super short, but it was actually taking 2.5 >> seconds. That was the whole reason I started tryin

Re: [go-nuts] profiling help

2022-01-12 Thread Steve Roth
you are > measuring is the runtime startup time / and the overhead of parsing the CGI > “protocol". This is not insignificant. CGI really only works well for long > requests IMO. > > On Jan 12, 2022, at 5:29 PM, Steve Roth wrote: > > Thank you, Ian. From the function names, I susp

Re: [go-nuts] profiling help

2022-01-12 Thread Steve Roth
profiling as you suggest. (And of course I've reviewed pprof blog post many times.) Regards, Steve On Wed, Jan 12, 2022 at 2:58 PM Ian Lance Taylor wrote: > On Wed, Jan 12, 2022 at 1:54 PM Steve Roth wrote: > > > > I am attempting to profile my code, and I'm unable to int

[go-nuts] profiling help

2022-01-12 Thread Steve Roth
I am attempting to profile my code, and I'm unable to interpret the results. So first, the meta-question is, what's the best forum to use to request help with such things? The code I'm profiling is the server side of a moderately complex webapp. For simplicity, I've wrapped it with net/http/cgi a

[go-nuts] unsafe string to []byte

2021-07-27 Thread Steve Roth
The implementation of io.WriteString appears to allocate a new byte slice and copy the string into it: w.Write([]byte(s)) Many third party libraries avoid the allocation and copy with techniques like: var b []byte sh := (*reflect.StringHeader)(unsafe.Pointer(&s)) bh := (*reflect.SliceHeader)(uns

[go-nuts] Re: Go based xml manipulation library

2021-02-11 Thread Steve Roth
github.com/beevik/etree does much of what you're looking for. Steve On Thursday, February 11, 2021 at 1:10:51 PM UTC-8 sunto...@gmail.com wrote: > Is there any Go library that allow certain following-sibling > manipulation? > > Specifically, I want

[go-nuts] prevent unnecessary escape to heap

2021-02-04 Thread Steve Roth
Hi, folks, I could use some assistance getting rid of some unnecessary heap allocations. I have code that needs to write individual bytes to an io.Writer. (The Writer implementation given to my code is probably buffered, but my code shouldn't rely on a particular concrete type.) The relevant par

[go-nuts] go.pkg.dev missing golang packages

2020-06-27 Thread Steve Roth
I understand that some Go package documentation is not documented on go.pkg.dev for licensing reasons. However, I would not have expected that packages maintained by the Go team itself would have such problems. Yesterday I discovered, for example, that the documentation for github.com/golang/freet

Re: [go-nuts] types of slice indices and range operators

2020-02-02 Thread Steve Roth
xplain why this pattern doesn’t work for you > (other than the common arguments for genetics)? > > On Feb 2, 2020, at 9:08 PM, Steve Roth wrote: > >  > Hi, Robert, > > Thanks for the quick replies. Let me address each of your points: > > "Slice indexes are ints&

Re: [go-nuts] types of slice indices and range operators

2020-02-02 Thread Steve Roth
xing, etc. Trivial and > can be done today. > > On Feb 2, 2020, at 8:28 PM, Robert Engels wrote: > >  > Also, what you are asking for I believe is covered by generics. > > On Feb 2, 2020, at 8:17 PM, Steve Roth wrote: > >  > Oh, please, Robert. No need to be c

Re: [go-nuts] types of slice indices and range operators

2020-02-02 Thread Steve Roth
lue. > > See https://tour.golang.org/moretypes/16 > > On Feb 2, 2020, at 7:39 PM, Steve Roth wrote: > >  > Greetings, > > I'm considering submitting a proposal for a language change, and would > like some informal feedback on the idea before engaging the formal > process.

[go-nuts] types of slice indices and range operators

2020-02-02 Thread Steve Roth
Greetings, I'm considering submitting a proposal for a language change, and would like some informal feedback on the idea before engaging the formal process. The idea being proposed here is intended to improve type safety by removing the need for some error-prone type casting. It is a backward c

[go-nuts] Re: What's the status of the new Go brand?

2018-08-25 Thread Steve Roth
Hmm, I wouldn't say "nothing" has changed. The golang.org site has gotten noticeably slower, particularly the package documentation. I have no idea whether that's related to this migration but it's definitely unfortunate. Steve On Saturday, August 25, 2018 at 8:30:17 AM UTC-7, Carla Pfaff wr

[go-nuts] Re: Go import tree

2017-07-30 Thread Steve Roth
https://github.com/davecheney/prdeps is another. Steve On Saturday, July 29, 2017 at 9:55:05 PM UTC-7, Tong Sun wrote: > > Is there any tools out there that can show import tree for Go projects? > I.e., the dependency graph that shows who imports what packages. > > During `go build -v` I saw one

[go-nuts] Re: RFC: Blog post: How to not use an HTTP router

2017-06-23 Thread Steve Roth
Hello, Axel, I like your concept and I am applying it. But I believe that the code in your blog post is broken. In various places you call head, r.URL.String = SplitPath(r.URL.String) But r.URL.String is a function, not a property. This code doesn't compile. I think perhaps maybe you meant

[go-nuts] Re: Minimizing golang docker images

2017-02-24 Thread Steve Roth
Hello, Sankar, The minimal Docker image for a Go webapp contains absolutely nothing in its filesystem other than the binary itself. Here's an example Dockerfile for such an image: FROM scratch COPY appname / EXPOSE 8000 CMD ["/appname"] However, to build the image, you have to have a full Go

[go-nuts] Re: storing transaction in context

2017-02-07 Thread Steve Roth
Fascinating. I didn't entertain the idea of putting the context in the transaction, for exactly the reason that Chetan cited. But it does seem like a good answer. (And yes, the transactions are short. Long-running transactions are an anti-pattern in their own right.) Many thanks for the inp

[go-nuts] []struct{} vs. []*struct{}

2017-01-10 Thread Steve Roth
Suppose you are reading a list of structures, and you do not know in advance how many there will be. I'm trying to figure out when it's better to append them to a slice of structures, and when it's better to append pointers to them to a slice of pointers. It's easy enough to to the math on ho

[go-nuts] redundant type specifiers

2016-12-21 Thread Steve Roth
The survey that was recently posted here asked, among other things, what changes to the language would be most useful. The one that immediately came to my mind was getting rid of the need for redundant type specifiers (examples below). It occurred to me that this must have been discussed befo

[go-nuts] validating self-signed certs

2016-12-08 Thread Steve Roth
I have an application that needs to talk to numerous external devices, each of which has only a self-signed cert. We can't simply accept all self-signed certs with insecureSkipVerify; instead, as part of configuring the application for each new external device, we need to import its self-signe