[go-nuts] Can write data and sync a removed file

2021-12-07 Thread Benjamin
The code is pretty simple, see below [image: Screen Shot 2021-12-08 at 1.23.19 PM.png] I added breakpoints at line 18. I manually removed the file /tmp/db, and then continued to run the file. Everything was working well. Is this a bug or expected behavior? -- You received this message becaus

Re: [go-nuts] Why runtime force gc every 2 minutes?

2021-12-07 Thread Kurtis Rader
On Tue, Dec 7, 2021 at 6:20 PM Kurnia D Win wrote: > Why runtime force gc every 2 minutes?, > https://github.com/golang/go/blob/016e6ebb4264f4b46e505bb404953cdb410f63f2/src/runtime/proc.go#L5226 > It's a heuristic. The Go developers probably observed that starting a GC approximately every two mi

[go-nuts] Why runtime force gc every 2 minutes?

2021-12-07 Thread Kurnia D Win
Why runtime force gc every 2 minutes?, https://github.com/golang/go/blob/016e6ebb4264f4b46e505bb404953cdb410f63f2/src/runtime/proc.go#L5226 AFAIK gc will be triggered when user try to allocate memory (the mallocgc func) and if user want to force gc every 2 minutes, they can create their own g

Re: [go-nuts] Re: Do you have a minimal runnable go code that contain all key words in go?

2021-12-07 Thread Rob Pike
Oh, it needs to be runnable. Never mind. -rob On Wed, Dec 8, 2021 at 11:19 AM Rob Pike wrote: > > It's easy to fold a few things together: https://go.dev/play/p/6lpZmGH9iJb > > Nice work though. > > On Wed, Dec 8, 2021 at 5:15 AM ben...@gmail.com wrote: > > > > Heh, nice! I made it three bytes

Re: [go-nuts] Re: Do you have a minimal runnable go code that contain all key words in go?

2021-12-07 Thread Rob Pike
It's easy to fold a few things together: https://go.dev/play/p/6lpZmGH9iJb Nice work though. On Wed, Dec 8, 2021 at 5:15 AM ben...@gmail.com wrote: > > Heh, nice! I made it three bytes smaller by defining "const t = true" (true > was used in 2 places). https://go.dev/play/p/-3SvzKYjGSr ... I ca

Re: [go-nuts] Re: Do you have a minimal runnable go code that contain all key words in go?

2021-12-07 Thread ben...@gmail.com
Heh, nice! I made it three bytes smaller by defining "const t = true" (true was used in 2 places). https://go.dev/play/p/-3SvzKYjGSr ... I can't think of any ways to reduce its (formatted) size further off the top of my head, but I'm sure there's bound to be something. On Tuesday, December 7, 2

Re: [go-nuts] Re: notify a server about changes in client side

2021-12-07 Thread Brian Candler
The handler func is called when the client calls this endpoint, *by definition* of what a handler function is. Depending on how your application is designed, you can either do work in the handler func, or you can make a note that some work needs to be done (for example, by putting a message in

Re: [go-nuts] Re: notify a server about changes in client side

2021-12-07 Thread RiSi
It means in the body of func/handler responsible for this POST Endpoint I pack the necessary actions and each time client calls this endpoint those actions will be also executed. Then I do not need to check regularly when called this endpoint of server. Sorry for my naivety Am Di., 7. Dez. 2021

[go-nuts] [ANN] Convert coverprofile to SVG heatmap

2021-12-07 Thread Nikolay Dubina
*What?* https://github.com/nikolaydubina/go-cover-treemap CLI to convert coverprofiles to nice looking SVG heatmaps *Why?* Useful for large projects with lots of files and sub packages. Useful if you can not (say due to legal or security) to use tools like Codacy or codecov.io. Thank you! 🎄

Re: [go-nuts] Re: notify a server about changes in client side

2021-12-07 Thread Brian Candler
> And this POST endpoint should be checked regularly to see when the changes happened? As by each change the server does some action. No, that's not how webservers work. Regardless of the language you are using: you write some code which handles the POST and returns a status code (and possibly

Re: [go-nuts] Re: notify a server about changes in client side

2021-12-07 Thread RiSi
And this POST endpoint should be checked regularly to see when the changes happened? As by each change the server does some action. As the server immediately after each POST request from client, need to do some action. How guarantee this in Go? Am Di., 7. Dez. 2021 um 14:11 Uhr schrieb Brian Candl

[go-nuts] Re: notify a server about changes in client side

2021-12-07 Thread Brian Candler
If the client is notifying the server of changes, then it can just make a HTTP POST to a server endpoint. Your server just needs to implement that endpoint to receive the POST request. If the server wants to notify the client of changes in real time, there are various approaches: e.g. Websocke

[go-nuts] notify a server about changes in client side

2021-12-07 Thread RiSi
Hi, having a server written in Go: this server provides an endpoint. The client(or consumer) calls this endpoint to notify server about the changes by him. My question is: How this server can check the notifications received from client? Available implementation approaches are unknown to me. Thank

[go-nuts] Re: Golang: http2 client immediately close connections via proxy while idleConn was enabled

2021-12-07 Thread Jérôme LAFORGE
nice issue number :) Le mardi 7 décembre 2021 à 05:54:13 UTC+1, zzk...@gmail.com a écrit : > I had opened an issue on the Golang repo, in case anyone interested. > > net/http2: client immediately close most of connections via forward proxy > even if idleConn was configured · Issue #5 · golan

Re: [go-nuts] spec: What does SimpleStmt do?

2021-12-07 Thread 'Axel Wagner' via golang-nuts
IMO the text as-is is fine. The point of the spec is to be confer meaning and I think the meaning of the current text is clear. Note that, strictly speaking, a SimpleStmt *does* control execution flow, in that it always continue executing the following statement. On Tue, Dec 7, 2021 at 10:02 AM Z

[go-nuts] spec: What does SimpleStmt do?

2021-12-07 Thread Zhuo Meng
>From spec: https://go.dev/ref/spec Statements is for* control execution*. If, else, select, return etc do change the control execution, however Stmt also included "SimpleStmt" can contains: SimpleStmt = EmptyStmt | ExpressionStmt | SendStmt | IncDecStmt | Assignment | ShortVarDecl . which