[go-nuts] Re: Intentionally omitting requires in go.mod - alternative to multi-module repository?

2022-01-30 Thread Leigh McCulloch
I'm a user of the sentry-go SDK who has been impacted by the large number of dependencies in the past. >Independently, if your users have automated tools that are issuing false-positive CVE warnings based on the module graph instead of the package-import graph, you may want to suggest that

Re: [go-nuts] Issues when using time.Ticker microsecond duration

2022-01-30 Thread envee
Thanks Kurtis and Robert. My use-case is for a telecommunications application (HTTP/2 client, 5G client to be precise) which needs to send 5G (HTTP/2) requests to a server at a configurable rate (TPS). While the telecom industry very commonly use the word TPS (Transactions Per Second), I

Re: [go-nuts] Issues when using time.Ticker microsecond duration

2022-01-30 Thread Robert Engels
Pretty much what Kurtis said. Low interval timers usually require specialized constructs if not a real time OS to efficiently (or even at all). > On Jan 30, 2022, at 9:16 PM, envee wrote: > > Thanks, but I am not sure how that reference solves the issue ? > Or are you suggesting that the

Re: [go-nuts] Issues when using time.Ticker microsecond duration

2022-01-30 Thread Kurtis Rader
On Sun, Jan 30, 2022 at 7:16 PM envee wrote: > Thanks, but I am not sure how that reference solves the issue ? > Or are you suggesting that the only way is to use Cgo and invoke usleep to > get very close to the Ticker duration specified ? > > On Monday, 31 January 2022 at 11:25:58 UTC+11

Re: [go-nuts] Issues when using time.Ticker microsecond duration

2022-01-30 Thread envee
Thanks, but I am not sure how that reference solves the issue ? Or are you suggesting that the only way is to use Cgo and invoke usleep to get very close to the Ticker duration specified ? On Monday, 31 January 2022 at 11:25:58 UTC+11 ren...@ix.netcom.com wrote: > See

Re: [go-nuts] Re: Why, oh why, do people do this? Things that annoy me in Go code.

2022-01-30 Thread Henry
And there is that ... LOL. I normally ignore "goto", but yes it can be turned into a looping construct. When refactoring code that uses "goto", I would try to eliminate "goto" first. If it isn't possible, then the execution flow must be so complex that it doesn't need to be broken down

Re: [go-nuts] Why Go allow function with unused arguments?

2022-01-30 Thread 'Dan Kortschak' via golang-nuts
On Sun, 2022-01-30 at 13:47 -0800, Sean Liao wrote: > By enforcing blanks, you'd lose the chance to name them something > useful to tell the reader why they're ignored. > eg: > // why are the last 2 args ignored?? > handleX = func(foo, bar, _, _ string) string { return foo + bar } >

Re: [go-nuts] Issues when using time.Ticker microsecond duration

2022-01-30 Thread Robert Engels
See https://github.com/golang/go/issues/27707 > On Jan 30, 2022, at 5:50 PM, envee wrote: > > Hi All, > I understand this issue has been discussed in the past, and I have seen a few > comments from Ian and Russ Cox about this topic, but I could not arrive at a > conclusion about how I can

[go-nuts] Issues when using time.Ticker microsecond duration

2022-01-30 Thread envee
Hi All, I understand this issue has been discussed in the past, and I have seen a few comments from Ian and Russ Cox about this topic, but I could not arrive at a conclusion about how I can make the time.Ticker send me ticks at atleast close to the Ticker duration I specify. At the moment, I am

[go-nuts] behaviour (issue) of time.Ticker microsecond duration ticks

2022-01-30 Thread envee
Hi All, I understand this issue has been discussed in the past, and I have seen a few comments from Ian and Russ Cox about this topic, but I could not arrive at a conclusion about how I can make the time.Ticker send me ticks at atleast close to the Ticker duration I specify. At the moment, I am

Re: [go-nuts] Why Go allow function with unused arguments?

2022-01-30 Thread Sean Liao
By enforcing blanks, you'd lose the chance to name them something useful to tell the reader why they're ignored. eg: // why are the last 2 args ignored?? handleX = func(foo, bar, _, _ string) string { return foo + bar } On Sunday, January 30, 2022 at 10:21:11 PM UTC+1

Re: [go-nuts] Why Go allow function with unused arguments?

2022-01-30 Thread Robert Engels
To the ops point, wouldn’t it be better to cause an error for unused parameters unless they use the blank identifier? > On Jan 30, 2022, at 2:09 PM, 'Dan Kortschak' via golang-nuts > wrote: > > On Sun, 2022-01-30 at 12:01 -0800, Kamil Ziemian wrote: >> Hello, >> >> This is a question from

Re: [go-nuts] Why Go allow function with unused arguments?

2022-01-30 Thread 'Dan Kortschak' via golang-nuts
On Sun, 2022-01-30 at 12:01 -0800, Kamil Ziemian wrote: > Hello, > > This is a question from ignorant in the meters of compilers and > mediocre Go users at best, so it may be stupid. > > I really like that in Go unused variable or import is compiler time > error. As such I wonder why function like

[go-nuts] Why Go allow function with unused arguments?

2022-01-30 Thread Kamil Ziemian
Hello, This is a question from ignorant in the meters of compilers and mediocre Go users at best, so it may be stupid. I really like that in Go unused variable or import is compiler time error. As such I wonder why function like > func funTest(x int) int { > return 3 > } is allowed? I

Re: [go-nuts] Re: Why, oh why, do people do this? Things that annoy me in Go code.

2022-01-30 Thread Tim Hardcastle
True, I don't say that meaningful names can entirely replace comments, just that comments can't replace the sort of meaningful if verbose names that OP objects to in point (1). A lot must depend on the personal equation, how well one reads chunks of camelCase, how well one reads abbreviations,

Re: [go-nuts] Re: Why, oh why, do people do this? Things that annoy me in Go code.

2022-01-30 Thread Brian Candler
On Sunday, 30 January 2022 at 11:31:25 UTC Henry wrote: > In Go, there is only one looping construct, which is the "for" keyword. > Don't forget "goto" :-) << ducks >> -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

Re: [go-nuts] Re: Why, oh why, do people do this? Things that annoy me in Go code.

2022-01-30 Thread Henry
Comments are useful to communicate what is not already apparent in your code. Sometimes comments may help you find bugs in your algorithms. On the other hand, keep your comments terse and not longer than what is necessary. Respect other people's time. Long names are not necessarily better. It