Re: [go-nuts] what is the origin of Go's reference time system?

2022-10-26 Thread Alex Besogonov
It’s possible to use a different method name (“FormatNew”?) to avoid back compat issues. But yeah, it would be a bit ugly. It might make sense to revisit this if Go ever grows i18n for datetimes. > On Oct 26, 2022, at 23:44, Rob Pike wrote: > > Not without breaking compatibility. > > -rob >

Re: [go-nuts] what is the origin of Go's reference time system?

2022-10-26 Thread Rob Pike
Not without breaking compatibility. -rob On Thu, Oct 27, 2022 at 5:15 PM Alex Besogonov wrote: > Can we perhaps get a bit more unambiguous reference date for it? > > On Wednesday, October 26, 2022 at 1:06:36 PM UTC-7 Rob 'Commander' Pike > wrote: > >> I believe it's unique. I thought of it one

Re: [go-nuts] what is the origin of Go's reference time system?

2022-10-26 Thread Alex Besogonov
Can we perhaps get a bit more unambiguous reference date for it? On Wednesday, October 26, 2022 at 1:06:36 PM UTC-7 Rob 'Commander' Pike wrote: > I believe it's unique. I thought of it one day while walking home. It is > inspired by the way Cobol picture clauses represent number formats. (That

Re: [go-nuts] Should io.WriterTo "seek to the end"?

2022-10-26 Thread Ian Lance Taylor
On Wed, Oct 26, 2022 at 8:14 PM Nigel Tao wrote: > > The io.WriterTo interface has come up in a code review discussion. > > ``` > // WriterTo is the interface that wraps the WriteTo method. > // > // WriteTo writes data to w until there's no more data to write or > // when an error occurs. The ret

[go-nuts] Should io.WriterTo "seek to the end"?

2022-10-26 Thread Nigel Tao
The io.WriterTo interface has come up in a code review discussion. ``` // WriterTo is the interface that wraps the WriteTo method. // // WriteTo writes data to w until there's no more data to write or // when an error occurs. The return value n is the number of bytes // written. Any error encounte

[go-nuts] Re: First stable version of several package under golang.org/x/

2022-10-26 Thread 'Heschi Kreinick' via golang-nuts
Yeah, text and tools were already tagged back from https://go.dev/blog/path-security, and we've started tagging some other golang.org/x repositories now. They'll be tagged every month or so if they have changes, and their dependencies on each other will be upgraded. Note that so far these are a

Re: [go-nuts] Embedding any (empty interface) in a struct in Go

2022-10-26 Thread 'Axel Wagner' via golang-nuts
On Wed, Oct 26, 2022 at 9:17 PM sick...@gmail.com wrote: > Consider a scenario where you want to embed an error within any type of > variable. > > This can be achieved by embedding any in a struct and it seems to be a > valid syntax in Go 1.9. > type WithError struct { > any >

Re: [go-nuts] what is the origin of Go's reference time system?

2022-10-26 Thread Rob Pike
I believe it's unique. I thought of it one day while walking home. It is inspired by the way Cobol picture clauses represent number formats. (That said, I've never programmed in Cobol.) -rob On Thu, Oct 27, 2022 at 4:51 AM Ayan George wrote: > > I'm really impressed by the simplicity of Go's t

[go-nuts] Reading data from GeoTIFF with the gdal package

2022-10-26 Thread Rick Walters
Hi, if anyone has any experience with Luke Roth's gdal package… I'm relatively new to Go, and very new to GeoTIFF and GDAL, and struggling a bit. I'm trying to read data from a 32-bit float band of a GeoTIFF (representing elevation) and have two questions: 1. Is there any way to directly a

[go-nuts] Embedding any (empty interface) in a struct in Go

2022-10-26 Thread sick...@gmail.com
Consider a scenario where you want to embed an error within any type of variable. This can be achieved by embedding any in a struct and it seems to be a valid syntax in Go 1.9. type WithError struct { any err error } func main() { a := WithError{ any: 5,

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

2022-10-26 Thread announce
Hello gophers, We plan to issue Go 1.19.3 and Go 1.18.8 on Tuesday, November 1. These minor releases include PRIVATE security fixes to the standard library. Following our security policy, this is the pre-announcement of those releases. Thanks, Tatiana and Heschi for the Go team -- You receive

[go-nuts] First stable version of several package under golang.org/x/

2022-10-26 Thread 'Michel Levieux' via golang-nuts
Hi all, I was bumping the dependencies of our codebase today, and noticed that many packages under golang.org/x/ had upgraded from a pseudo-version to a real, semver version: - golang.org/x/net v0. 0.0-20220927171203-f4

[go-nuts] what is the origin of Go's reference time system?

2022-10-26 Thread Ayan George
I'm really impressed by the simplicity of Go's time formatting and parsing mechanisms -- particularly when compared with strftim(). Does anyone know the origin or history of it? Is there a precedent for using reference layouts that include string like 2006, January, etc.? Do other languages p

Re: [go-nuts] Any information about adding a trailing comma in ast CompositeLit (for structs)

2022-10-26 Thread David Finkel
On Mon, Oct 24, 2022 at 9:27 PM Tajmeet Singh wrote: > Thanks for looking at it :smile: > > Could you elaborate more on how the `SetLines` would work on a > `token.FileSet`? I thought that `SetLines` is only for the `os.File` types > :sweat: Do you mean that I should create offsets (using SetLine

Re: [go-nuts] Occasional hard lockup w/ 100% CPU usage in go applications

2022-10-26 Thread Konstantin Khomoutov
On Wed, Oct 26, 2022 at 08:45:00AM -0500, Robert Engels wrote: > Trigger a core dump then use gdb on the core file. Also, the gdb is usually shipped with the `gcore` helper which can attach to the specified PID and dump its core. -- You received this message because you are subscribed to the G

Re: [go-nuts] Occasional hard lockup w/ 100% CPU usage in go applications

2022-10-26 Thread Steven Sokol
Typo. 1.19.1 On Wednesday, October 26, 2022 at 8:52:16 AM UTC-5 Jan Mercl wrote: > On Wed, Oct 26, 2022 at 3:28 PM Steven Sokol > wrote: > > > Currently running go 1.9.1, but I've been having this same issue since I > started working on this project about two years ago on 1.5.x. > > That versi

Re: [go-nuts] Occasional hard lockup w/ 100% CPU usage in go applications

2022-10-26 Thread Jan Mercl
On Wed, Oct 26, 2022 at 3:28 PM Steven Sokol wrote: > Currently running go 1.9.1, but I've been having this same issue since I > started working on this project about two years ago on 1.5.x. That version is 5 years old: https://go.dev/doc/devel/release#go1.9 Can you try a recent, supported ver

Re: [go-nuts] Occasional hard lockup w/ 100% CPU usage in go applications

2022-10-26 Thread Robert Engels
Trigger a core dump then use gdb on the core file. > On Oct 26, 2022, at 8:33 AM, Steven Sokol wrote: > >  > I've tried using strace and it just locks up (and requires SIGKILL to break > out). What's the best way to get a native sampling, gdb? (Delve won't run on > this platform.) > > > >

Re: [go-nuts] Occasional hard lockup w/ 100% CPU usage in go applications

2022-10-26 Thread Steven Sokol
Currently running go 1.9.1, but I've been having this same issue since I started working on this project about two years ago on 1.5.x. On Tuesday, October 25, 2022 at 8:06:35 PM UTC-5 eric.h...@gmail.com wrote: > What version of GoLang? tried different ones? > > -Eric > http://www.google.com/p

Re: [go-nuts] Occasional hard lockup w/ 100% CPU usage in go applications

2022-10-26 Thread Steven Sokol
I've tried using strace and it just locks up (and requires SIGKILL to break out). What's the best way to get a native sampling, gdb? (Delve won't run on this platform.) On Tuesday, October 25, 2022 at 8:10:12 PM UTC-5 ren...@ix.netcom.com wrote: > I would try an external sampling. The stack t

Re: [go-nuts] Analyse postgresql error

2022-10-26 Thread Konstantin Khomoutov
On Wed, Oct 26, 2022 at 01:38:51PM +0300, David Harel wrote: [...] > func errorCheckResult(err error) string { > if err == nil { > return "" > } > pqerr := err.(*pq.Error) > switch pqerr.Get('C') { > case "23505": > return "Key violation" > } > return "E

Re: [go-nuts] Analyse postgresql error

2022-10-26 Thread David Harel
Thanks for your reply. After I submitted my question I made some progress and found that: The infrastructure of my solution is using the pq package - import " github.com/lib/pq" The marshaling method is not relevant anymore. I can analyse the error by casting to pq.Error. Code example: func erro

Re: [go-nuts] gollvm build fails

2022-10-26 Thread Alex Markin
Thank you for your advice! I compared the good and the bad build log and found out the lack of rule zgoarchat all. So I mentioned the difference in makefiles and it turned out that I used different revisions of gollvm. It is interesting that with gcc this problem did not appear (but in both gcc an