RE: [go-nuts] Should os.WriteFile call Sync()?

2025-04-17 Thread 'Bushnell, Thomas' via golang-nuts
I'm sorry you experienced data loss here, but I don't think Go is remiss. The only thing in the entire API that refers to stable storage is the Sync call; on a correctly-behaving system you do not ever need to call Sync. It is only needed if you are protecting against an incorrectly-behaving sys

[go-nuts] Returning success from a canceled goroutine in an gRPC server stub

2025-03-26 Thread 'Bushnell, Thomas' via golang-nuts
e reflected back to the RPC client? [Note that in a non-gRPC context, in which these are just all local function calls, the answer is defined by the Go Language Specification - the return value is of course returned no matter what the state of the context may be.] Thomas -- You received this mes

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

2025-02-20 Thread 'Bushnell, Thomas' via golang-nuts
Thanks Ian. This is more or less what I expected. Is there any hope for extending the current mechanism to provide a per-import or per-module-in-go.mod way to specify a build tag? Thomas -Original Message- From: Ian Lance Taylor Sent: Wednesday, February 19, 2025 5:36 PM To: Bushnell

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

2025-02-19 Thread 'Bushnell, Thomas' via golang-nuts
nt to solve for the Go ecosystem; if the feature really is "don't use this feature" then arguably the feature should be abandoned. If it's to be kept as a feature, then there should be some way to use it safely. Thomas -- You received this message because you are subscrib

[go-nuts] Re: Go 1.22.0: Alpine: go test with coverage works but returns exit status 1

2024-02-08 Thread Thomas McNulty
While trying to upgrade a go package to 1.22.0 today, I ran into this same issue in my coverage step. From testing different combinations of options for `go test`, it seems that the 'no such file or directory' errors and resulting non-zero exit code occur when go test processes a folder/package

[go-nuts] Re: Symbolic/Concolic execution of Go compiled Binaries

2023-11-02 Thread 'Thomas DuBuisson' via golang-nuts
There was an effort to add golang as a supported language to crucible [1], but I think it fizzled as a one-engineer attempt. I know golang compiles via an SSA but is there even a spec for the SSA? Static analysis attempts tend to be mostly academic and thus favor something solid such as llvm (or

Re: [go-nuts] How to constrain an integral type's values

2023-09-08 Thread 'Thomas Bushnell BSG' via golang-nuts
I recommend using strings as the base type for things like this, rather than ints. There is no need to use ints, just because that's what C uses. Thomas On Fri, Sep 8, 2023 at 3:24 AM 'Mark' via golang-nuts < golang-nuts@googlegroups.com> wrote: > I often create smal

Re: [go-nuts] Re: From which programming language did the idea for Golang's interface mechanism design originate?

2023-09-01 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
pick behaviors (and thus something like Go's interfaces) as superior to classes (like Java or Python typically use). Thomas On Fri, Aug 25, 2023 at 12:27 AM Rob Pike wrote: > It was dreamed up independently at the whiteboard on the first day of > design discussions. We did not know E

Re: [go-nuts] Please consider voting to reopen Golang subreddit

2023-06-26 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
you don't like it, vote with your feet", while complaining about the actions some other users of the site have taken, and not voting with your feet. Thomas On Fri, Jun 23, 2023 at 4:29 AM Jan Mercl <0xj...@gmail.com> wrote: > On Fri, Jun 23, 2023 at 10:18 AM Axel Wagner > w

Re: [go-nuts] Parsing time with timezones seem to fail

2023-02-13 Thread &#x27;Thomas Casteleyn' via golang-nuts
Hi Sam, While I do acknowledge there might be some timezones that are ambiguous, it certainly is not the case for CET and MST. IMHO those should be able to be correctly parsed by time.Parse and time.ParseInLocation. If provided an ambiguous timezone to time.Parse, that should maybe return an er

Re: [go-nuts] Parsing time with timezones seem to fail

2023-02-10 Thread &#x27;Thomas Casteleyn' via golang-nuts
, _ = time.ParseInLocation(layout, v, loc) glibc is doing this better IMHO. On Thursday, February 9, 2023 at 8:47:52 PM UTC+1 Ian Lance Taylor wrote: > On Thu, Feb 9, 2023 at 11:26 AM 'Thomas Casteleyn' via golang-nuts > wrote: > > > > Hi, I originally asked on Gophers sla

[go-nuts] Parsing time with timezones seem to fail

2023-02-09 Thread &#x27;Thomas Casteleyn' via golang-nuts
Hi, I originally asked on Gophers slack where they directed me to this group. It seems I'm not able to parse these 2 timestamps with timezone correctly: https://go.dev/play/p/VZwD29701ps The responses show confusing time formats and the playground even seems to be more wrong than on my local m

[go-nuts] goppls with DocLinks

2022-12-31 Thread Thomas Peugeot
s not the case ? Is this because g 1.19 is too recent or is it a more fundamental problem ? Thanks, Thomas -- 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 e

Re: [go-nuts] Re: Why not tuples?

2022-12-07 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
Use the json package to parse the incoming data. Transform it as you please. Use the json package to format the output. I'm not sure I see the problem. On Sat, Dec 3, 2022, 10:47 PM Diogo Baeder wrote: > Hi there, sorry for weighting in so late in the game, but I just started > again to learn G

Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
lass with a behavior, and then using classes as names for behaviors. On Tue, Nov 22, 2022 at 11:46 AM Robert Engels wrote: > What would be the purpose of writing B calling a method on A that doesn’t > exist? > > On Nov 22, 2022, at 10:36 AM, 'Thomas Bushnell BSG' via go

Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
does not support late binding - indeed, this is the point of the keyword, and is why I remarked that this is because they couldn't figure out how to do it efficiently. Thomas On Tue, Nov 22, 2022 at 11:25 AM Robert Engels wrote: > Why do you say that Java does not have late binding. It

Re: [go-nuts] clarifying Go FAQ: Is Go an object-oriented language?

2022-11-22 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
Asking "the definition of object oriented programming" seems a bad idea to me. Alan Kay invented the term, and he was pretty clear that C++ was not anything like what he had in mind, and yet, a lot of people think C++ is an object oriented language. I don't, as it happens. Inheritance used to be t

[go-nuts] Re: [security] Go 1.19.3 and Go 1.18.8 pre-announcement

2022-10-30 Thread Thomas Frössman
d/msgid/golang-announce/SqV2R4AQQTOjO-b9c0RHQA%40geopod-ismtpd-2-3 > <https://groups.google.com/d/msgid/golang-announce/SqV2R4AQQTOjO-b9c0RHQA%40geopod-ismtpd-2-3?utm_medium=email&utm_source=footer> > . > -- Thomas Frössman https://t.jossystem.se <http://t.jossystem.se>

Re: [go-nuts] Race detector question

2022-09-15 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
; This is not what “happens before” means - at least not in any other > accepted concurrency designs. > > See my second example as to why. > > On Sep 15, 2022, at 10:02 AM, Thomas Bushnell BSG > wrote: > > Happens before works just fine with atomics. But in your example, x is

Re: [go-nuts] Race detector question

2022-09-15 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
15, 2022 at 11:08 AM robert engels wrote: > This is not what “happens before” means - at least not in any other > accepted concurrency designs. > > See my second example as to why. > > On Sep 15, 2022, at 10:02 AM, Thomas Bushnell BSG > wrote: > > Happens before

Re: [go-nuts] Race detector question

2022-09-15 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
Happens before works just fine with atomics. But in your example, x is not an atomic. Thomas On Thu, Sep 15, 2022 at 10:51 AM robert engels wrote: > Yea, the race detector is broken… it fails on the following code: > > package main > > import ( >"sync" >

Re: [go-nuts] Race detector question

2022-09-15 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
detector ensures the synchronization property you're suggesting? The race detector doesn't ensure any synchronization properties; it detects bugs. I think it is capable of detecting this one. Thomas On Wed, Sep 14, 2022 at 11:01 PM robert engels wrote: > Hi, > > I am working on

Re: [go-nuts] Is Go a security malware risk?

2022-08-22 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
This is not a problem that arises from *you *using Go; it's a problem arising from the fact that *other *people are using Go to write malware, and bad security techniques are unable to deal with it. You could stop using Go entirely and it wouldn't change the dynamic. The better course is not to re

Re: [go-nuts] Go Mod SSH doesn't work

2022-08-05 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
I'm confused; while I haven't used that sort of setup, the documentation does seem to address the case. https://go.dev/ref/mod#module-proxy https://go.dev/ref/mod#vcs https://go.dev/ref/mod#private-modules I can't tell from what you're saying whether you're using those facilities or not, but that

Re: [go-nuts] How to run a java file using go script.

2022-08-04 Thread &#x27;Thomas Faughnan' via golang-nuts
On Thu Aug 4, 2022 at 12:24 AM EDT, TECHAX wrote: > I tried the following one but still, it's not working. > > *os.Setenv("PATH","/home/sdk/jdk-11.0.16/bin")* > *cmd,_:=exec.Command("java","-version").Output()* > *fmt.Println(string(cmd))* > > Since the path is set, so it should display the java ve

Re: [go-nuts] Pointer to a pointer

2022-03-15 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
15, 2022 at 4:41 PM Thomas Bushnell BSG > wrote: > > > Not in the normal implementation it doesn't. Typically it might be: > > > > type element struct { > > value int > > next *element > > } > > > > next is a pointer to an element, not a

Re: [go-nuts] Pointer to a pointer

2022-03-15 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
that it's not quite PA that we're modeling here so much as PA numerals what happens if we are working in a space where the Numbers might be non-standard? The functions now don't terminate, but because of Tennenbaum's Theorem, there might be very little we can do to improve

Re: [go-nuts] Pointer to a pointer

2022-03-15 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
s a pointer to an element, not a pointer to a pointer. That element contains *within it *a pointer, but next is not a pointer to a pointer. If it were, it would be declared with two stars. Thomas -- You received this message because you are subscribed to the Google Groups "golang-nuts"

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

2022-01-31 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
On Fri, Jan 28, 2022 at 1:12 PM Rudolf Martincsek wrote: > > 2) Long variable names. > > Where I work (not in Go), writing comments is frowned upon. That includes > "docblock" style comments. If a function needs to be documented, it means > the implementation is too complex and must be broken apa

Re: [go-nuts] Re: Problem using embed in Go 1.16

2021-10-12 Thread Thomas Frössman
flag.Parse() >> >> // There is also a mandatory non-flag arguments >> if len(flag.Args()) < 1 { >> usage() >> } >> >> fmt.Printf("\nAfter parsing the flags\n") >> fmt.Printf("CPU: '%s'\n", cpuArch) >> >> }

[go-nuts] Re: Generate benchmark binary

2021-06-22 Thread Thomas Pelletier
If anyone finds this, here is a proof of concept: https://github.com/pelletier/go-bb. -- 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...@goo

[go-nuts] Generate benchmark binary

2021-06-16 Thread Thomas Pelletier
compiler to that temporary directory. This seems extremely brittle, full of corner cases. Any other idea? Thank you! Thomas -- 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

Re: [go-nuts] go text://protocol client?

2021-04-14 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
In *Ash Wednesday, *T. S. Eliot wrote the line "Lady, three white leopards sat under a juniper tree in the cool of the day" When he was asked what it meant, he aisd "It means, 'Lady, three white leopards sat under a juniper tree in the cool of the day'" I suspect if there were a better way

Re: [go-nuts] text/template: Can't call method/function with 0 results.

2021-04-09 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
I find the current behavior clearer. What would you like a no-valued function to insert in the template? Even if it was the zero value, that could be the string-typed zero value, or the int-typed zero value, and so forth. It could be defined, but why not make it explicit if you want it to insert n

Re: [go-nuts] Re: Update to generics proposal

2021-04-06 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
On Mon, Apr 5, 2021 at 9:04 PM yiyus wrote: > > then I guess you mean that interface { MyInt } will accept any type > > argument whose underlying type is the same as the underlying type of > > MyInt. But that seems strange. There is no connection between MyInt > > and MyInt2, except that they ha

Re: [go-nuts] Re: A message from the CoC committee

2021-03-24 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
d. This basically puts a stop to it, because people repeatedly filing groundless petitions generally don't care to pay $300 for each one, together with the expense of duplicating forty bound copies of the petition in the exacting format required. Thomas -- You received this message becaus

Re: [go-nuts] now that the election is over can we please remove the political ad for golang.org

2021-03-18 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
cannot speak for the Go authors, and I certainly cannot speak for Google, but I can say for my part that I want a very clear and very bright sign that racists are not welcome here, no matter how brilliantly they can write computer programs. Thomas -- You received this message because you are subscr

Re: [go-nuts] now that the election is over can we please remove the political ad for golang.org

2021-03-18 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
On Wed, Mar 17, 2021 at 8:22 AM mortdeus wrote: > Why do black lives matter more than Syrian lives? Nobody said they do. The banner does not make any comparisons. Thomas -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To uns

Re: [go-nuts] now that the election is over can we please remove the political ad for golang.org

2021-03-18 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
end you resist the impulse to keep starting one. Thomas -- 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 vie

Re: [go-nuts] Code coverage in error cases when compared to other languages

2021-02-05 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
On Thu, Feb 4, 2021 at 4:35 PM Charles Hathaway wrote: > Hey all, > > Thomas, I agree that the code you provide would benefit from unit tests, > but I would like to focus my question on the very common case which simply > throws the error without additional edge cases, such as th

Re: [go-nuts] Code coverage in error cases when compared to other languages

2021-01-28 Thread &#x27;Thomas Bushnell BSG' via golang-nuts
IMO: To give these things names, you have: func Foo(...) ..., error { do things here... err := makeASubroutineCall(...) if err != nil { return ..., err } do more things } And we suppose that makeASubroutineCall is already will tested and you know it returns errors correctly. What i

Re: [go-nuts] chan chan question

2020-06-22 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
You can send any object you like across a channel of the appropriate type. It sends the actual object (in this case, the channel) just as for an integer, it sends the value, or for a map, the whole map. errChan in the snippet you quote is an ordinary variable, and this is its declaration (like any

Re: [go-nuts] [design] HTTP server serving heavy computing : Handle HTTP request closed prematurely

2020-06-21 Thread Thomas S
y here, but I expect this to be at least a little > faster than a select. > > In any case, these things must happen explicitly: code that wants to be > responsive to cancellation signals must be programmed as such. > > > On Fri, Jun 19, 2020 at 3:58 PM Thomas S > > wrot

[go-nuts] [design] HTTP server serving heavy computing : Handle HTTP request closed prematurely

2020-06-19 Thread Thomas S
Hello, I have an HTTP server providing heavy algorithms. Sometimes, the clients closes the connection prematurely, before the end of computing. Note : Sometimes the client consuming these algorithms want to stop the process if the solution is not found before X minutes for example. This articl

Re: [go-nuts] [generics] replace ()/(type ) with :[]

2020-06-18 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
On Thu, Jun 18, 2020 at 9:46 AM Kiswono Prayogo wrote: > Personally () parentheses seems like to be harder to read, too similar > with function calls. > This is exactly why I like it. These are parameters, and should be thought of just like other parameters in a function call. -- You received t

Re: [go-nuts] Re: political fundraising on golang.org!

2020-06-16 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
use is advertised, all should be, or that if a non-abusive banner is present, then abusive ones must be allowed too. Thomas -- 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, se

Re: [go-nuts] Re: political fundraising on golang.org!

2020-06-16 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
s one shouldn't be supported, or that you need to filter the notice out. How does that help the other worthy causes you mention? Thomas -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop re

Re: [go-nuts] political fundraising on golang.org!

2020-06-15 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
means you have acquired a right to control other people's actions, including those who run golang.org. Thomas -- 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

Re: [go-nuts] political fundraising on golang.org!

2020-06-15 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
et, here we are. We all sometimes have to think about things we would rather not think about. Thomas -- 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 go

Re: [go-nuts] political fundraising on golang.org!

2020-06-15 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
ssure you > that elements of the BLM platform are very fringe with little support in > the minority community- specifically the defund the police - so having a > white person shouting from their ivory tower about what’s right for these > communities is laughable. > > On Jun 15, 2

Re: [go-nuts] political fundraising on golang.org!

2020-06-15 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
itant? And if so, why? This is not a request for you to answer these questions here, but a request for you to consider them yourself, and place their needs and interests ahead of your own for a moment. Thomas On Mon, Jun 15, 2020 at 11:01 AM Thomas Bushnell, BSG wrote: > Eric: It's

Re: [go-nuts] political fundraising on golang.org!

2020-06-15 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
Eric: It's not your list. You don't get to decide the policies of the list. On Sun, Jun 14, 2020 at 4:44 PM Eric S. Raymond wrote: > Sam Whited : > > This is not a simple political issue, it is a personal human issue. It > > is a social issue. It is a justice issue. > > It is the injection of po

Re: [go-nuts] political fundraising on golang.org!

2020-06-15 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
I'm saddened by all the snowflakes who can't handle a message they disagree with for a second, which is literally costing them exactly nothing. I'm also saddened by anyone who thinks the message itself is somehow objectionable. But I won't stop being an anti-racist just because some people are mad

Re: [go-nuts] Re: what is the complexity of regexp.MustCompile()?

2020-06-09 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
On Tue, Jun 9, 2020 at 11:23 AM Axel Wagner wrote: > If you actually read OPs second E-Mail, they did and they didn't find it > very clear. With that in mind, your message isn't very nice. > (Also, not to be repetitive or anything: ~80% of the messages in this > thread aren't actually concerned w

Re: [go-nuts] Re: what is the complexity of regexp.MustCompile()?

2020-06-09 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
I'm surprised none of you have taken all this time to just go read the code, where it is clearly linear. On Mon, Jun 8, 2020 at 9:12 PM Robert Engels wrote: > The OP specifically asked about compilation - in fact it’s in the title. > You stated the compilation complexity is a DoS attack vector.

Re: [go-nuts] Re: what is the complexity of regexp.MustCompile()?

2020-06-08 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
On Mon, Jun 8, 2020 at 12:02 PM Axel Wagner wrote: > On Mon, Jun 8, 2020 at 5:41 PM Thomas Bushnell, BSG > wrote: > >> The OP was about MustCompile, so I think it's clear they are not using >> patterns passed in by external requests. >> > > I don't t

Re: [go-nuts] Re: what is the complexity of regexp.MustCompile()?

2020-06-08 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
The OP was about MustCompile, so I think it's clear they are not using patterns passed in by external requests. On Mon, Jun 8, 2020 at 9:39 AM Robert Engels wrote: > I will claim it also doesn’t matter because you need external bounding > anyway. Take a simple recursive directory listing. It is

Re: [go-nuts] Is this a safe way to block main thread but not main goroutine?

2020-04-29 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
That seems needlessly complex. Why not just skip the weird init, and just have main do a go to the thing you want to be not on the main thread, and let the main thread do its thing? On Wed, Apr 29, 2020 at 4:19 PM Akhil Indurti wrote: > I want to run the main goroutine on another thread besides

Re: [go-nuts] Best design to copy a struct

2020-04-21 Thread Thomas S
I did not know this stylistic guideline. Thank you Ian ! Le mardi 21 avril 2020 00:42:39 UTC+2, Ian Lance Taylor a écrit : > > On Mon, Apr 20, 2020 at 1:56 PM Thomas S > > wrote: > > > > In regexp package, the "copy" function is implemented like this

[go-nuts] Best design to copy a struct

2020-04-20 Thread Thomas S
Regexp { 119 return &re 120 } What do you think ? Do I nitpick? Thank you dear gophers, Thomas -- 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 em

Re: [go-nuts] An important proposal will fail without your support

2020-03-10 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
In C it's called _. While it's not normally considered good Go style, you could use a "." import of the package, and call the function G. Then: "fmt.Println(G("message text at %t with %n bytes"), time, number) Notice that (following C) the gettext lookup function is called with the string, and n

[go-nuts] Re: [security] Go 1.12.16 and Go 1.13.7 pre-announcement

2020-01-24 Thread Rosatto, Thomas
Is there anything we need to do for this? Thank you, Thomas Rosatto – Offer/Disco Services From: on behalf of Katie Hockman Date: Thursday, January 23, 2020 at 2:32 PM To: golang-nuts Subject: [security] Go 1.12.16 and Go 1.13.7 pre-announcement Hello gophers, We plan to issue Go 1.12.16

[go-nuts] Re: Reordering error output in flags package so Usage is printed before the error?

2019-12-08 Thread Thomas Nyberg
ssing with the source of standard library? Cheers, Thomas On Sunday, December 8, 2019 at 12:00:44 PM UTC+1, Thomas Nyberg wrote: > > Hello, > > Given the following file `flag_example.go`: > > package main > > import "flag" > > func main() { > flagNa

[go-nuts] Reordering error output in flags package so Usage is printed before the error?

2019-12-08 Thread Thomas Nyberg
Help message. (default "flagValue") flag needs an argument: -flagName In other words, I would like to move the error to the end. Is there an easy way to achieve this? I know about changing Usage, but that doesn't seem to affect this specific issue. Thanks for any help! Cheers,

Re: [go-nuts] Difference with function returning struct and function returning pointer to struct

2019-11-20 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
nter indirection (so it's addressable) and the field selection is thus addressable too. Thomas On Wed, Nov 20, 2019 at 5:41 PM Orson Cart wrote: > > I'm a newbie to Go having used C and C++ in the past and I'm puzzled about > something I've just seen. > > In

[go-nuts] Chimithèque v2 released

2019-09-26 Thread Thomas Bellembois
Hello Gophers, I have released a chemical products management application for schools and universities (or others). https://github.com/tbellembois/gochimitheque This is a project started in 2015 that has been rewritten in Go. This may interest chemical engineers or teachers. Regards, Thomas

Re: [go-nuts] Existing production-ready libraries for parallelizing HTTP requests?

2019-08-20 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
I am of the opinion that a case like this is best handled by simply writing the thing you want. Concurrency limits are easily managed by using tokens to gate fetches. One simple technique is to make a channel of struct{} with capacity equal to the maximum number of concurrent connections you are a

Re: [go-nuts] Preparing defaults for multiple-values-returning functions

2019-07-23 Thread Thomas Bruyelle
I prefer to define a local func that returns the default values. https://play.golang.org/p/UOPdouwoy0v (Moreover you should avoid using `else` behind `return`) Le lundi 22 juillet 2019 21:08:53 UTC+2, Robert Engels a écrit : > > Depends on the length of the function, and number of branches/tests

Re: [go-nuts] Re: Adding a timeout to a script interpreter (without leaking a goroutine)

2019-05-30 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
plus you'd lose the ability to compute ackerman's function, which i'm doing all the time On Wed, May 29, 2019 at 7:35 AM adonovan via golang-nuts < golang-nuts@googlegroups.com> wrote: > On Tuesday, 21 May 2019 01:18:34 UTC-4, Ben Hoyt wrote: >> >> I'm looking at adding a timeout option to my GoA

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-25 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
I'm a big fan of the ternary operator in general. Maybe this is because I'm an old timey Lisper. A lot of the things people see as "abuse" or "too complex" are equally problems with || and &&. This is also true for Jan's point: that ?: affects control flow by omitting execution sometimes. It would

Re: [go-nuts] What does "identifier...type" mean in a function definition?

2019-04-25 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
"..." is called an ellipsis (plural ellipses). The presence or absence of the space is unimportant; you're seeing the way gofmt formats it, but the parser doesn't care. Since period is not a legitimate constituent of an identifier name, they scan in separate tokens either way. On Thu, Apr 25, 20

Re: [go-nuts] Question regarding gob

2019-03-26 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
I mean, everything except the things that are not pointers. On Tue, Mar 26, 2019 at 2:45 PM Robert Engels wrote: > This is not really true. In Java everything is a pointer (reference) and > has no problem with the semantics of passing a reference, it is built into > the serialization. They may b

Re: [go-nuts] bytes.Buffer.ReadAt?

2019-03-25 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
Notice the logic in (*bytes.Buffer).grow which will throw away already read data, specifically in the case n <= c/2--m. On Mon, Mar 25, 2019 at 9:57 AM fREW Schmidt wrote: > Oh thanks, I'll switch my code to reader, though as far as I can tell, > bytes.Buffer doesn't discard already read data, i

[go-nuts] Elastic synchronised logging : What do you think ?

2019-03-16 Thread Thomas S
Hello, I have a software needing a lot of logs when processing. I need to : 1- Improve the processing time by doing non-blocking logs 2- Be safe with goroutines parallel logs fmt package doesn't match with (1) & (2) log package doesn't match with (1) *Here is my proposal. What do you think ?*

Re: [go-nuts] Find biggest memory holder

2019-02-07 Thread Thomas S
ize of the objects pointed to are changing. > > The question is not very clear though. > > > On Feb 7, 2019, at 12:33 PM, Ian Lance Taylor > wrote: > > > > On Thu, Feb 7, 2019 at 2:33 AM Thomas S > wrote: > >> > >> But now, to go forward, I

[go-nuts] Find biggest memory holder

2019-02-07 Thread Thomas S
elementary upgrade thanks to this. [image: cg_ext.png] *But now, to go forward, I need a monitoring of my globals variables.* And not of the "run consumption" of ram. Any ideas on how to do this efficiently ? Thank you ! Thomas -- You received this message because you a

Re: [go-nuts] Re: Wuffs: a new, memory-safe programming language

2019-01-11 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
On Fri, Jan 11, 2019 at 9:33 AM Eric S. Raymond wrote: > Thomas Bushnell, BSG : > > Suppose it has a way, however. Now you have Go code which will have a > > bounds fault instead of a data leak. That's better, I suppose - the > > resulting bug is now "the server

Re: [go-nuts] Re: Wuffs: a new, memory-safe programming language

2019-01-10 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
On Thu, Jan 10, 2019 at 10:49 AM Jesper Louis Andersen < jesper.louis.ander...@gmail.com> wrote: > On Thu, Jan 10, 2019 at 7:39 PM Thomas Bushnell, BSG > wrote: > >> >>> The server crashes - that's how we handle "any other exception", as a >>

Re: [go-nuts] Re: Wuffs: a new, memory-safe programming language

2019-01-10 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
ot;crashes the server immediately with a single packet". Maybe the result actually makes things worse. :) I don't know what you mean by "just fork the process". First, if you're transpiling into Go, that's not a good strategy. Second, are you suggesting the transp

Re: [go-nuts] Re: Wuffs: a new, memory-safe programming language

2019-01-10 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
On Thu, Jan 10, 2019 at 8:50 AM Jesper Louis Andersen < jesper.louis.ander...@gmail.com> wrote: > On Wed, Jan 9, 2019 at 7:55 PM 'Thomas Bushnell, BSG' via golang-nuts < > golang-nuts@googlegroups.com> wrote: > >> >> I'm curious about why transpi

Re: [go-nuts] Re: Wuffs: a new, memory-safe programming language

2019-01-09 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
, automatically, what a win!") but in practice, I'm not sure I see such a transpiler actually working in a way that would achieve the result - and the end is to preserve a profound denial of service attack anyway. Thomas -- memegen delenda est -- You received this message because you

Re: [go-nuts] Json decode : Monitoring errors properly

2019-01-05 Thread thomas
I got it. In fact, if the buffer is bad, it is not erased, and Buffered() returns it (and not the following). That was my misunderstanding. Thank you all ! On Thursday, 27 December 2018 00:31:12 UTC+1, Kevin Conway wrote: > > > I believe https://golang.org/pkg/encoding/json/#Decoder.Buffered was

[go-nuts] Json decode : Monitoring errors properly

2018-12-26 Thread Thomas S
Sorry I don't get it ? My decoder is already built with it. Thank you, Thomas -- 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 golan

[go-nuts] Json decode : Monitoring errors properly

2018-12-26 Thread Thomas S
ing something to handle this better ? Thanks a lot for your answers. Thomas -- 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

[go-nuts] small utility for i3 wm users

2018-11-29 Thread Thomas Bellembois
Hello Gophers, I have written a small script to display the open application names in the i3 wm workspace bar. You can also map each application to a custom name. I use the great i3/go-i3 package (https://github.com/i3/go-i3). https://github.com/tbellembois/goi3autowname Regards, Thomas

Re: [go-nuts] Re: Compatibility between golang.org/x/crypto/argon2 and the legacy one

2018-10-11 Thread Thomas Bruyelle
Yes, that's acceptable. Le jeu. 11 oct. 2018 à 21:28, Sam Whited a écrit : > On Thu, Oct 11, 2018, at 14:14, Thomas Bruyelle wrote: > > That say, the downside is I have to keep both hash system, until all > users > > connect, which can take a long time, or can never

Re: [go-nuts] Re: Compatibility between golang.org/x/crypto/argon2 and the legacy one

2018-10-11 Thread Thomas Bruyelle
That say, the downside is I have to keep both hash system, until all users connect, which can take a long time, or can never happen! Le jeu. 11 oct. 2018 à 21:08, Thomas Bruyelle a écrit : > This is brillant, thanks again Sam. > I think I'll go for something like that. The argon2 ha

Re: [go-nuts] Re: Compatibility between golang.org/x/crypto/argon2 and the legacy one

2018-10-11 Thread Thomas Bruyelle
e jeu. 11 oct. 2018 à 21:01, Sam Whited a écrit : > On Thu, Oct 11, 2018, at 13:56, Thomas Bruyelle wrote: > > Unfortunately, because of that version mismatch, all my users' hashes > were > > created with a version not supported by golang.org/x/crypto/argon2, so > I >

Re: [go-nuts] Compatibility between golang.org/x/crypto/argon2 and the legacy one

2018-10-11 Thread Thomas Bruyelle
obre 2018 19:10:45 UTC+2, Sam Whited a écrit : > > On Thu, Oct 11, 2018, at 11:37, Thomas Bruyelle wrote: > > I want to update my authentication code by using > > golang.org/x/crypto/argon2, as a replacement of > > github.com/tvdburgt/go-argon2 which uses the legacy C

[go-nuts] Re: Compatibility between golang.org/x/crypto/argon2 and the legacy one

2018-10-11 Thread Thomas Bruyelle
obre 2018 18:37:07 UTC+2, Thomas Bruyelle a écrit : > > Hi all, > > I want to update my authentication code by using > golang.org/x/crypto/argon2, as a replacement of > github.com/tvdburgt/go-argon2 which uses the legacy C lib under the hood > through CGO. > The main be

[go-nuts] Compatibility between golang.org/x/crypto/argon2 and the legacy one

2018-10-11 Thread Thomas Bruyelle
Hi all, I want to update my authentication code by using golang.org/x/crypto/argon2, as a replacement of github.com/tvdburgt/go-argon2 which uses the legacy C lib under the hood through CGO. The main benefit is of course to drop the usage of CGO. But I encounter a serious issue, with the same

[go-nuts] How to monitor "Out of memory" crash

2018-10-05 Thread Thomas S
ed, pprof can't produce the final file for after-run analysis. Thank you for your help. Thomas -- 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

Re: [go-nuts] Re: why does go reverse the order of name and type? "i int" vs "int i"

2018-09-21 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
Pascal. But C's order is the same as Algol's, which is the same as FORTRAN's. Go's and Pascal's order is, however, the same as COBOL. Thomas -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-19 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
On Wed, Sep 19, 2018 at 4:04 PM robert engels wrote: > > The opinion that well, since there is no implements I can define my own > interface, and pass some stdlib struct that I can’t control as an > “implementor” is hogwash. Because you also don’t control this code, the API > is free to change -

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-19 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
hy it falls down in many places. It doesn’t mean it isn’t GREAT for what > it was designed to do, and better than Java in many (most) of these cases. > Large enterprise apps, no way. > > > On Sep 19, 2018, at 8:39 AM, Thomas Bushnell, BSG > wrote: > > Huh? Type safety is still check

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-19 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
Huh? Type safety is still checked by the compiler. Implements does nothing except put a road-block in the way and prohibit you from making an interface that some other package happens to implement. On Wed, Sep 19, 2018 at 1:40 PM Robert Engels wrote: > Go not having implements is a big problem w

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-18 Thread &#x27;Thomas Bushnell, BSG' via golang-nuts
n will be unacceptable to anyone who isn't lucky, or performance doesn't matter and you don't need a sophisticated collection class at all. (Or you're in the small well-known set of data types that we are confident *can *be implemented generically - but this is a small and static

Re: [go-nuts] Re: Perf : Multithreaded goroutines files I/O

2018-09-17 Thread Thomas S
Thank you ! -- 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. For more options, visit https://groups.google.com/d/optout.

Re: [go-nuts] Re: Perf : Multithreaded goroutines files I/O

2018-09-17 Thread Thomas S
Is my time display method wrong ? t := time.Now() // Process fmt.Println(time.Since(t)) Le dimanche 16 septembre 2018 22:54:33 UTC+2, Michael Jones a écrit : > > don't be confused about internal process time and external wall clock time > here. > > On Sun, Sep 16, 201

[go-nuts] Re: Perf : Multithreaded goroutines files I/O

2018-09-16 Thread Thomas Solignac
> them sequentially? It seems that there is somewhere else a bottleneck... > > Am Sonntag, 16. September 2018 14:08:50 UTC+2 schrieb Thomas Solignac: >> >> Hello, >> >> I have a loading step, where I have something like 60 files to read and >> process, as fast as pos

  1   2   >