Re: [go-nuts] Re: Does go:embed embed.FS embeds directories or possible confusion with how it works

2023-01-24 Thread Shammi Shailaj
Thanks Ian. changing it to *http.Handle("/static/", http.FileServer(http.FS(fs.Sub(static,"files"* did work. On Tuesday, 24 January 2023 at 01:52:40 UTC+5:30 Ian Lance Taylor wrote: > On Mon, Jan 23, 2023 at 11:51 AM Shammi Shailaj > wrote: > > > > There is no function named Sub() for t

[go-nuts] [Potential Performance issue] Concurrent File upload time is linearly increasing; Need help

2023-01-24 Thread prabodh shrivastava
package main import ( "bytes" "crypto/tls" "fmt" "io" "io/ioutil" "mime/multipart" "net/http" "os" "path/filepath" "strconv" "sync" "time" ) func main() { test() time.Sleep(10 * time.Minute) } func test() { for i := 0; i < 50; i++ {

Re: [go-nuts] How is this pattern for declaring and initalizing slices of known length?

2023-01-24 Thread Ian Lance Taylor
On Tue, Jan 24, 2023 at 7:15 PM nc wrote: > > Thanks! This is quite helpful information. I have one small followup > question: when you use make([]type, len) and assign, if you were using a > range loop, that would require an index variable right? In the case of > ranging over a slice or array

Re: [go-nuts] How is this pattern for declaring and initalizing slices of known length?

2023-01-24 Thread nc
Thanks! This is quite helpful information. I have one small followup question: when you use make([]type, len) and assign, if you were using a range loop, that would require an index variable right? In the case of ranging over a slice or array or string you could use the range's index variable,

Re: [go-nuts] How is this pattern for declaring and initalizing slices of known length?

2023-01-24 Thread Ian Lance Taylor
On Tue, Jan 24, 2023 at 12:01 PM nc wrote: > > I have some sample code here: https://play.golang.com/p/H4kOGxamk0_D > > I have used a pattern in the above playground snippet (twice: once in > uniqueValues() and once in keys()) that declares and initializes a slice > like: s := make([]T, 0, known

[go-nuts] How is this pattern for declaring and initalizing slices of known length?

2023-01-24 Thread nc
Hi, I have some sample code here: https://play.golang.com/p/H4kOGxamk0_D I have used a pattern in the above playground snippet (twice: once in uniqueValues() and once in keys()) that declares and initializes a slice like: s := make([]T, 0, knownLength) . Then it ranges over something containin

[go-nuts] Observing Large GC STW time during mark setup phase

2023-01-24 Thread Neetish Pathak
Hi All, Golang version 1.18.2 Have a kvstore implemented in golang. There is a proxy layer that communicates with storage that uses CGo for data access from storage engine. Both proxy and storage are implemented in golang. I observe that there are occasional spikes in the latency. (< 0.01%