Re: [go-nuts] Will the generics support be enabled by default in Go 1.18?

2021-10-14 Thread Henry
I thought that hiding generics behind a flag is already a thing in Go 1.17? If a feature is solid enough for stable release, don't make it an opt-out. People can just avoid the language features they don't want to use. I disagree with the suggestion of adding stuffs to go.mod to enable or

[go-nuts] Re: Inconsistency between calls to "os.Chtimes()" and "stat.Sys().(syscall.Stat_t).Mtimespec"

2021-10-14 Thread Uli Kunitz
Hi, I suggest that you check on MacOs the File System Events API and on Linux inotify or fanotify. Here are links: https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/FSEvents_ProgGuide/UsingtheFSEventsFramework/UsingtheFSEventsFramework.html

Re: [go-nuts] testing if strconv.Quote() would do change a string, without calling it

2021-10-14 Thread 'Tim Hockin' via golang-nuts
I tried: strconv.Quote() strconv.AppendQuote() (weird that this is faster than Quote) fmt.Sprintf("%q") scanning for !IsPrint() + bytes.Buffer scanning for !IsPrint() + strings.Builder (sad that this is not faster than Buffer) scanning for !IsPrint() + string addition ``` $ go test -benchtime=5s

Re: [go-nuts] Inconsistency between calls to "os.Chtimes()" and "stat.Sys().(syscall.Stat_t).Mtimespec"

2021-10-14 Thread Kurtis Rader
Please don't send screen captures. They're hard to read and people can't copy/paste the code. Ideally you would send a https://play.golang.org/ link but simply copy/pasting your code into the email is fine too. Note that file timestamp resolution depends on the system: both hardware and OS. Even

Re: [go-nuts] testing if strconv.Quote() would do change a string, without calling it

2021-10-14 Thread roger peppe
On Thu, 14 Oct 2021 at 04:58, 'Tim Hockin' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Thanks for confirming. I wrote that function and erased a good bit of the > overhead. > > bytes.Buffer for the no-escapes path and strconv.Quote otherwise. > Could you not use strconv.AppendQuote

[go-nuts] Re: Clearing sessions

2021-10-14 Thread Brian Candler
Your application should never panic. If the cookie is invalid, treat it as if the cookie were not set at all, and redirect to the login page. As for security: I urge you to think again. I can see your postgres instance blocks connections from unknown source IPs in pg_hba.conf, but that's a

[go-nuts] Re: Clearing sessions

2021-10-14 Thread Денис Мухортов
Answering the first one, my server panics with the error: secure cookie: the value is invalid. The error occurs if I restart the server and the session is saved in the browser. For me, it's enough just to delete this value from the browser so that the server starts without panic, but I would

Re: [go-nuts] go get "github.com/gbin/goncurses" fails--invalid flag in pkg-config

2021-10-14 Thread richard thiebaud
It turns out that the bad options were in the pkg-config for ncurses on my computer. Once I deleted them from the pkg-config files for ncurses and all related items, the problem went away and github.com/gbin/goncurses worked as expected. On Monday, October 11, 2021 at 12:40:01 AM UTC-4 Ian

[go-nuts] Re: Clearing sessions

2021-10-14 Thread Brian Candler
1. If you are getting a panic, then you should show the complete error message together with the backtrace, and it will help someone diagnose what's going on. I don't think that simply having stale sessions in your cookie store should cause your program to crash. Indeed, that's one of the