[go-nuts] [ANN] Pion-TURN, a TURN server designed with ease of use and extensibility in mind

2018-05-14 Thread sean
Hi list! I wrote a TURN server and would love to get feedback/share https://github.com/pions/turn If you aren't interested in the code, but just want a TURN server there are already built releases that work on Windows/Darwin/Linux/FreeBSD and should just take 5 mins to get running! These are

[go-nuts] Re: [ANN] Pion-TURN, a TURN server designed with ease of use and extensibility in mind

2018-05-19 Thread sean
This review is fantastic! I committed what I understood, I have a few questions though. > Instead of turn.Server a more idiomatic interface name could be something like turn.ClientAuthenticator Should I change this name, but still keep things like the realm/socket as members still? I think of t

[go-nuts] DTLS 1.2 implementation, looking for reviewers and a path forward to x/net

2018-11-14 Thread sean
Hey gophers! I built a DTLS 1.2 library (https://github.com/pions/dtls) it was originally built to support pion-WebRTC (https://github.com/pions/dtls) but I would really like to get it into x/net so everyone can use, share and contribute! I think especially with security software as important

[go-nuts] Go modules do not respect vendor folder of dependencies (is this by design?)

2019-02-09 Thread sean
* I have a project 'A' that is importing 'B' * 'B' uses a vendor folder, if you delete the vendor folder the project does not compile. * With `GO111MODULE=on` I am unable to project 'A'. It tries to pull the latest of 'B', and everything 'B' depends on (instead of using 'B's vendor folder) Does

[go-nuts] [ANN] Pion WebRTC a Pure Go implementation of the WebRTC API (v2.0.* has stabilized!)

2019-05-13 Thread sean
If you are new to WebRTC it is a really amazing technology, and lots of powerful things can be built with it. It isn't just a technology for conferencing, you can build powerful P2P software that works on all platforms (including your browser!) You can see it in use in places like IPFS[0] so co

[go-nuts] [CGO] How can I convert GoString to wchar_t?

2020-09-26 Thread Sean
pt bool) {     b := C.bool(bool)     C.Tolk_Output((*C.wchar_t)(text), b) } error: .\talker.go:39:28: cannot convert text (type string) to type *_Ctype_ushort Sean * Email: seantolstoyev...@protonmail.com <mailto:seantolstoyev...@protonmail.com> * GitHub: SeanTolstoyevski <https://githu

[go-nuts] Garbage Collector triggering when deleting an object

2020-11-22 Thread Sean
I am writing a Golang wrapper for OpenAL-Soft. I need to create some buffers. These operations are happening on the OpenAL-Soft side (So C functions). I am loading PCM data into buffers. Can I set up a trigger mechanism like "x.__del__" as in Python? I can set the garbage collector to follow s

[go-nuts] How to set the "godebug" environment variable from the go file?

2020-12-16 Thread Sean
hi all, i have a project I have to work with CGo. I want to disable some controls as they are not good enough right now. It works when I write "set godebug=cgocheck=0" on Windows in console. However, this is a GUI program. Console should not open. I tried this with "os.Setenv". I define it in "

Re: [go-nuts] How to set the "godebug" environment variable from the go file?

2020-12-18 Thread Sean
hing. On 17/12/2020 00:28, Ian Lance Taylor wrote: On Wed, Dec 16, 2020 at 8:49 AM Sean wrote: hi all, i have a project I have to work with CGo. I want to disable some controls as they are not good enough right now. It works when I write "set godebug=cgocheck=0" on Windows in console. Howe

[go-nuts] Re: Possible Go 2 proposal for built-in Remove method for Slices.

2021-02-06 Thread Sean
I think there is definitely a need for a built-in "*remove*" function for arrays and slice. Everyone is writing their own implementation for this, it is both confusing and "x = append(a[:x], b[x:])" like blablabla is not readable. 5 Şubat 2021 Cuma tarihinde saat 02:55:36 UTC+3 itibarıyla sela

[go-nuts] Does crypto/AES work on hardware that doesn't have the aes instruction set? Hello, Will crypto/aes, cipher/GCM work on hardware without embedded aes support?

2021-12-02 Thread Sean
Hello, Will **crypto/aes**, **cipher/GCM** work on hardware without embedded aes support? What I want to know is how these packages respond in cases where there is no embedded AES support (fast is not important). -- You received this message because you are subscribed to the Google Groups "g

[go-nuts] Performance of syscall calls vs. CGO

2022-01-20 Thread Sean
Hi groups, I know CGO is not performing well in Golang at the moment. If we use a dll will this performance issue decrease? If I do the cgo calls with syscall, will there be no performance improvements? When I think about it, Golang always has to make syscall calls on the os it's running on. For

Re: [go-nuts] Performance of syscall calls vs. CGO

2022-01-21 Thread Sean
radar and improve. On 20/01/2022 23:25, Ian Lance Taylor wrote: On Thu, Jan 20, 2022 at 2:54 AM Sean wrote: I know CGO is not performing well in Golang at the moment. That is true, but we should quantify it. The last time I tested it, a cgo call took about 10 times as long as an ordinary funct

[go-nuts] Re: Go += Package Versioning

2018-02-24 Thread Sean Russell
Russ, I'm working on adding support for Bitbucket, per your comment in #23950 . I'm struggling a bit with executing the tests in x/vgo -- should I expect vgo test to work? I feel like I'm missing something obvious. I added unit tests first and they'

Re: [go-nuts] Re: Go += Package Versioning

2018-02-25 Thread Sean Russell
On Sunday, February 25, 2018 at 1:08:31 AM UTC-5, Sam Whited wrote: > > FYI, there is an active CL for this here: https://golang.org/cl/95578 > Thanks Sam -- I found it, and it's working fine. I'm still curious as to what I'm doing wrong in executing the tests in x/vgo . --- SER -- You recei

Re: [go-nuts] Include tests in binary and run them

2019-07-10 Thread Sean Liao
I think testing.MainStart() does what you want though do nore the caveats https://golang.org/pkg/testing/#MainStart -- 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

[go-nuts] Re: Include tests in binary and run them

2019-07-10 Thread Sean Liao
actually looking into it more since *_test,go files aren't included in a normal build you are probably better off just writing your tests as normal functions if you want them included in the final build -- You received this message because you are subscribed to the Google Groups "golang-nuts"

[go-nuts] Re: GAE - Telegram bot stops working after some period of time

2019-09-15 Thread Sean Liao
switch to using a webhook so telegram calls you through a handler this is a limitation of GAE's request based model On Sunday, September 15, 2019 at 4:04:29 PM UTC+2, Andreas wrote: > > > > I uploaded a simple telegram bot to google-aplication-engine. And after > uploading it works as expected s

[go-nuts] Re: GAE - Telegram bot stops working after some period of time

2019-09-16 Thread Sean Liao
e > > go http.ListenAndServeTLS("0.0.0.0:8443", "cert.pem", "key.pem", nil) > > or > > go http.ListenAndServeTLS("patternbot.appspot.com:8443", "cert.pem", > "key.pem", nil) > > ? > > > On Sunday,

[go-nuts] Adding dimension to 2d slice loses dimension order

2019-10-13 Thread Sean Liao
Yes, order should be preserved A reproducible code snippet would be much more helpful in identifying the issue here -- 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

[go-nuts] Auto-renew letsencrypt cert with standard library code

2019-11-05 Thread Sean Liao
1. Check certificate expiry (stdlib) 2. Implement ACME client to request certificate 3. Respond to a challenge (the http one is easy) 4. Restart server with new certificate -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

[go-nuts] 1.13.4: go mod: weird permissions in pkg/mod after go get

2019-11-22 Thread Sean Liao
The module cache GOPATH/pkg/mod has no write permissions to prevent accident modifications to the files (they are versioned and checksummed, modifying them would fail the checksum). -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

[go-nuts] Re: Install vim-go as a pacakge in vim 8

2016-09-19 Thread Sean Russell
On Monday, September 19, 2016 at 5:13:21 AM UTC-4, Tamás Gulácsi wrote: > > Nope, I'm on neovim (with plug for the plugins) for a long time now... I don't think I even needed a plug for the plugins -- I just cp -r ~/.vim ~/.config/nvim and everything worked, including vim-go. --- SER -- You r

[go-nuts] Re: iconvg: a compact, binary format for simple vector graphics

2016-10-25 Thread Sean Russell
Hi, On Monday, October 24, 2016 at 2:52:48 AM UTC-4, Nigel Tao wrote: > > The Material Design icon set (https://design.google.com/icons/) > consists of 961 vector icons. As SVG files, this totals 312,887 bytes. > As 24*24 pixel PNGs, 190,840 bytes. As 48*48 pixel PNGs, 318,219 > bytes. As IconV

Re: [go-nuts] Idea for versioning in the new Go package manager.

2016-11-01 Thread Sean Russell
Hi, On Wednesday, October 26, 2016 at 4:42:13 AM UTC-4, Axel Wagner wrote: > > I thought about this too, but came to the conclusion that this would first > require a good definition of what "API breakage" actually means. > > In it's strictest interpretation as "any go package that imports this w

[go-nuts] polymorphism (for Go 2.0), new fast playground is live

2016-06-13 Thread Sean Russell
Interesting work. I understand this is very much a work in progress; how would you (eventually) see the implementation of map(), e.g.: https://play.golang.org/p/GogrfKf-oA Or is this an accepted limitation of functionality for simplicity, that any single generic scope must have at most a singl

[go-nuts] I found a quote that explains why I find Go beautiful!

2016-06-13 Thread Sean Russell
Nice! -- 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.

[go-nuts] Re: polymorphism (for Go 2.0), new fast playground is live

2016-06-16 Thread Sean Russell
For others: use Firefox for his playground; it doesn't function in Chrome on either my tablet and or my laptop. --- SER On Monday, June 13, 2016 at 9:41:52 AM UTC-4, charr...@gmail.com wrote: > > > > On Monday, June 13, 2016 at 1:28:26 PM UTC+2, Sean Russell wrote: >>

[go-nuts] Re: polymorphism (for Go 2.0), new fast playground is live

2016-06-16 Thread Sean Russell
Hi, On Monday, June 13, 2016 at 9:41:52 AM UTC-4, charr...@gmail.com wrote: > > for reference, here is the mymap() > > http://tsoh.host/test.html#8e4ae712 > > it simply runs the callback on every slice member > I apologize; I didn't communicate my question well. Your map example functions on a

[go-nuts] Re: polymorphism (for Go 2.0), new fast playground is live

2016-06-16 Thread Sean Russell
I'm sorry -- the "share" button doesn't seem to be working, or doesn't work in Firefox or Chrome. And I have a window hung on "waiting for remote server," so I might have broken your playground. Here's my code in (hopefully) compileable form for your processor: package main impoort "strconv

[go-nuts] Re: A proposal for generic in go

2016-06-22 Thread Sean Russell
On Tuesday, June 21, 2016 at 10:29:37 AM UTC-4, Henry wrote: > You still haven't provided any argument why generics is indispensable. That can't be the litmus for language feature inclusion; if it was, Go would resemble ASM. In my personal experience, something North of 50% of my non-trivial

Re: [go-nuts] How to hide command line argument from ps

2016-06-22 Thread Sean Russell
On Tuesday, June 21, 2016 at 9:56:21 PM UTC-4, Lazytiger wrote: > Thanks for all the replies. I agree that there is a better way to do the > security jobs. I ask this question just for curiosity, to find out if there > is a equivalence way to do this in golang. From all the replies I assume > th

Re: [go-nuts] How to hide command line argument from ps

2016-06-23 Thread Sean Russell
> On Jun 23, 2016, at 8:00 AM, Nick Craig-Wood wrote: > > Environment variables are quite insecure too. On linux you can read any > processes environment variables using /proc/PID/environ, eg Env variables are more secure than ps, which is what your question asked. Maybe a linux forum would

[go-nuts] Re: A proposal for generic in go

2016-06-29 Thread Sean Russell
On Wednesday, June 29, 2016 at 2:31:59 AM UTC-4, Egon wrote: > > Just to be clear what I consider a *great example* for analyzing generics: > > 2. 3+ real-world packages/applications use that package > * By real-world here I mean it wasn't written for learning or fun, but > rather solving a conc

Re: [go-nuts] What dependency management tool do you use?

2016-07-12 Thread Sean Russell
On Tuesday, July 12, 2016 at 4:25:42 PM UTC-4, Peter Mogensen wrote: > gvt > > It's KISS and does the job. +1 gvt is the best I've used. * It doesn't force checking in the dependencies * The manifest is straightforward and easily committed separately * It's nicely encapsulated entirely in the v

Re: [go-nuts] What dependency management tool do you use?

2016-07-13 Thread Sean Russell
Hi Nathan, On Wednesday, July 13, 2016 at 11:43:09 AM UTC-4, Nathan Fisher wrote: > Out of curiosity if the upstream deletes their repo does a force push > invalidating a sha or in some other way causes a dangling reference how do you > protect against that without checking the dependency in? I'm

[go-nuts] Re: Plot Go's benchmark result

2019-12-06 Thread Sean Liao
not sure if this fits https://github.com/codingberg/benchgraph On Friday, December 6, 2019 at 2:21:47 AM UTC+1, Tong Sun wrote: > > Hi, > > Any existing tools out there that can turn Go's benchmark result from text > into chart? > > I'm looking for a simple/light-weighted solution, like using

[go-nuts] Re: About the change for default "-mod=vendor" in Go 1.14

2020-01-08 Thread Sean Liao
works for me when tested with gp1.14beta1, are you sure your go.mod has the "go 1.14" directive? go's tooling currently assumes vendor is a full local copy of all code needed to build a module with modules the recommended way is to have your patched / unavailable module somewhere else and poin

[go-nuts] Re: odd benchmark results for time.Now() call inside vs outside mutex

2020-02-24 Thread Sean Liao
maybe it's just your system? master » gotip test -bench . goos: linux goarch: amd64 pkg: testrepo-75 BenchmarkStateSet1-44173546 273 ns/op BenchmarkStateSet2-44547119 261 ns/op BenchmarkStateSet3-44556757 263 ns/op PASS ok testrepo-75 4.899s On Monday, February 2

[go-nuts] Unable to pull Golang 1.14-alpine3.11 using Docker

2020-02-25 Thread Sean Farrow
.13.8-alpine3.11, so wondered whether something was amiss? This is all using Docker for windows running using Linux containers. Any help appreciated. Thanks, Sean. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

[go-nuts] Can plugins be used across repositories?

2020-02-29 Thread Sean Russell
Has anyone had any success using plugins across repositories using Go modules? I have two github repositories; one uses plugins (USER), the other contains a plugin (USED). I have a tag on a commit in the USER repo, and the go.mod in the USED repo references that version. Both go.mod files ref

[go-nuts] Re: Bencharking issue with b.StartTimer and b.StopTimer. Was: Benchmark using b.StopTimer and b.StartTimer has unexpected behaviour - to me at least

2020-03-24 Thread Sean Liao
see https://github.com/golang/go/issues/27217 On Tuesday, March 24, 2020 at 5:24:08 PM UTC+1, Orson Cart wrote: > > I posted this earlier but I realised that the code had a fundamental error > in it. I've corrected here it but the underlying problem still exists. > > I've recently started using g

Re: [go-nuts] Re: Bencharking issue with b.StartTimer and b.StopTimer. Was: Benchmark using b.StopTimer and b.StartTimer has unexpected behaviour - to me at least

2020-03-24 Thread Sean Liao
setup upfront shouldn't be a problem b.N is constant throughout the function lifetime, the entire function is called multiple times during benchmarking On Tuesday, March 24, 2020 at 9:56:19 PM UTC+1, Orson Cart wrote: > > On Tuesday, 24 March 2020 20:47:07 UTC, Robert Engels wrote: >> >> One way

Re: [go-nuts] Re: Pseudo version showing different in go1.12 and go1.13

2020-04-03 Thread Sean Liao
https://golang.org/cmd/go/#hdr-Pseudo_versions The note about v0.0.0 originally being the only form is relevant -- 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 g

[go-nuts] Re: Pseudo version showing different in go1.12 and go1.13

2020-04-03 Thread Sean Liao
> (This was originally the only form, so some older go.mod files use this form even for commits that do follow tags.) older refers to vgo, go1.11, go1.12 On Wednesday, April 1, 2020 at 2:07:19 PM UTC+2, Nitish Saboo wrote: > > Hi, > > I created go.mod file from two different go versions 1.12 and

Re: [go-nuts] Re: Pseudo version showing different in go1.12 and go1.13

2020-04-04 Thread Sean Liao
yes On Sat, Apr 4, 2020, 17:07 Nitish Saboo wrote: > Hi Sean, > > Thank you for your response. > The pseudo version that I am getting in go-1.13 is 'v1.8.3-0' and if you > see there is a "-0" in the pseudo version. > Whereas, > The pseudo version that I

Re: [go-nuts] Re: Pseudo version showing different in go1.12 and go1.13

2020-04-05 Thread Sean Liao
://golang.org/cmd/go/#hdr-Pseudo_versions On Sun, Apr 5, 2020 at 2:49 PM Nitish Saboo wrote: > > Hi Sean, > > Thank you for your response. > I hope you meant 'yes' for both the questions that I had postedam I right? > > Thanks, > Nitish > > > On S

[go-nuts] Re: Possible bug in turning versions into pseudo-versions

2020-04-29 Thread Sean Liao
go does mean semver.org when it refers to semver > Modules must be semantically versioned according to semver[,...] refers to what the numbers mean, the v prefix is required but not part of the version, more clearly explained in a faq on semver.org: > Is “v1.2.3” a semantic version? > No, “v1.2

[go-nuts] Re: Possible bug in turning versions into pseudo-versions

2020-04-29 Thread Sean Liao
semver point 10: > Build metadata MUST be ignored when determining version precedence. chat log from slack: > 22:29 bcmills Tags with metadata are not unique: there is only a partial order among them, not a total order. > 22:30 In contrast, MVS requires a total order. (We can't choose between v

[go-nuts] [Generics] Concise generics with package level types

2020-06-23 Thread teeling . sean
Imagine the following function definition, under the current proposal (I believe this is correct): func (s MyMap(K, V)) DoSomething(k K, v V) (func(type K Hashable) (k K) (V, error)) {...} At least for me, the above takes a while for me to grok. In my opinion the current proposed syntax gets

Re: [go-nuts] [generics] is generics with constrain needed ?

2020-06-23 Thread teeling . sean
Instead of doing the implicit conversion to the interface, why not relax the constraint and allow anything that implements the interface? On Wednesday, June 17, 2020 at 1:37:35 AM UTC-7, David Anderson wrote: > > The non-generic form _only_ accepts an argument of type []Stringer. If you > have a

Re: [go-nuts] Go1.15 + SQLite Driver + Windows + Ld.exe results in ld error "unrecognized option --high-entropy-va"

2020-08-14 Thread Sean O'Neil
back even farther to get it working again? Thanks, Sean On Thursday, August 13, 2020 at 3:13:51 PM UTC-4 Ian Lance Taylor wrote: > On Thu, Aug 13, 2020 at 12:01 PM Corey Gilmore > wrote: > > > > Setup: > > - Go 1.15 > > - https://github.com/mattn/go-sqlite3 SQL driver &

Re: [go-nuts] Go1.15 + SQLite Driver + Windows + Ld.exe results in ld error "unrecognized option --high-entropy-va"

2020-08-14 Thread Sean O'Neil
Never mind, I just noticed the original post answered it. Sorry, read it too quickly. On Thursday, August 13, 2020 at 3:13:51 PM UTC-4 Ian Lance Taylor wrote: > On Thu, Aug 13, 2020 at 12:01 PM Corey Gilmore > wrote: > > > > Setup: > > - Go 1.15 > > - https://github.com/mattn/go-sqlite3 SQL d

[go-nuts] [ANN] Pion WebRTC v3.0.0 Released

2020-12-23 Thread Sean DuBois
Pion WebRTC is a Go implementation of WebRTC. If you haven't used it before check out awesome-pion[0] or example-webrtc-applications[1] for what people are doing. We maintain a feature list and other helpful resources in our README.md[2] I am so excited to finally post this! This release was a l

[go-nuts] Re: Question on module versioning expected behavior

2021-03-25 Thread Sean Liao
go1.16 defaults to `-mod=readonly`, so a build will fail with: ``` fix/kin-51-compat » go build ./... pkg/chi-middleware/oapi_validate.go:14:2: no required module provides package github.com/getkin/kin-openapi/routers; to add it: go get github.com/getkin/kin-openapi/routers pkg/chi-middleware/oa

[go-nuts] Re: io/fs adapters?

2021-03-28 Thread Sean Liao
https://pkg.go.dev/testing/fstest ? On Sunday, March 28, 2021 at 5:09:12 AM UTC+2 aind...@gmail.com wrote: > For testing library functions that accept fs.FS, I've been creating mock > FS implementations. However, I'm surprised by the amount of code I've had > to write for something like an FS w

Re: [go-nuts] I'm missing godoc for local packages after converting to modules.

2021-03-28 Thread Sean Liao
Assuming a recent enough version of `godoc`, running it from within a module should include the documentation for the standard library (standard library section), that module, and all its dependencies (third party section) Expected output should be similar to: $ godoc using module mode; GOMOD=/

[go-nuts] Re: How to stream across json-seq RFC-7464

2021-03-29 Thread Sean Liao
If you can guarantee your input is always pretty printed like that, you could use bufio with a custom splitfunc to match `\n{`, no need to double parse json On Sunday, March 28, 2021 at 11:35:20 PM UTC+2 greg.sa...@gmail.com wrote: > > I've tried this suggestion and although its certainly a bit

[go-nuts] Re: What is src/hash/test_gen.awk in Go's source code for?

2021-04-16 Thread Sean Liao
The comment in the file explains that it' was used to generate test cases, used: https://go.googlesource.com/go/+/e3b793004fe9fb169099026e8c8d732913ec2ffa/src/lib/hash/sha1_test.go#20 A variant of the test still exists, https://go.googlesource.com/go/+/refs/heads/master/src/crypto/sha1/sha1_test.g

[go-nuts] Re: A question about go bug template

2021-04-24 Thread Sean Liao
1 for consistency in the report template (helps triagers) 2 GOROOT may actually be set separately On Saturday, April 24, 2021 at 9:34:17 AM UTC+2 manlio@gmail.com wrote: > In the go bug template, go version is printed twice, the first time in > the "go version" section and the second time i

[go-nuts] Re: Multi-word Project Name

2021-04-28 Thread Sean Liao
Yes that can be your module name, it won't affect much On Wednesday, April 28, 2021 at 10:14:55 PM UTC+2 iammadab wrote: > Hi, I have a github repository name (sherlock-server) of which I have > found no one word description that captures the essence. > > Can I name the module github.com/usernam

[go-nuts] Re: vendoring related question/issue

2021-05-09 Thread Sean Liao
`go mod vendor` only includes what is needed to build your main module. 1.16 has https://pkg.go.dev/embed so you can embed static assets (such as template/html files) into your final binary (they will also be available in the vendor directory but I don't think this is your final goal) On Sunday,

Re: [go-nuts] Json to CSV parsing with raw Data

2021-05-28 Thread Sean Liao
maybe something like https://play.golang.org/p/z-Yp4bh7jto On Friday, May 28, 2021 at 6:59:34 PM UTC+2 manlio@gmail.com wrote: > On Friday, May 28, 2021 at 6:26:46 PM UTC+2 sharathc...@gmail.com wrote: > >> QuoteToAscii converts non printable characters to \xd , but i literally >> want the

[go-nuts] Re: packages for a self-hosted http(s) (reverse?) multi-proxy

2021-06-06 Thread Sean Liao
net/http/httputil.ReverseProxy should do it https://pkg.go.dev/net/http/httputil#ReverseProxy I think it's easier if you set it up as a standard server and configure a SingleHostReverseProxy as a handler for each of the upstreams On Sunday, June 6, 2021 at 10:28:15 AM UTC+2 Sebastien Binet wrot

[go-nuts] Re: unexpected behavior http.MaxBytesReader & streaming response

2021-06-18 Thread Sean Liao
I think it's working as expected? The panic originates in your code: ``` err := decoder.Decode(&el) if err != nil { panic(err) } ``` What you should be doing is to break out of the loop and handle the error (client sending more than you want to read) gracefully On Friday, June 18, 2021 at 4:32:1

[go-nuts] Re: Help me troubleshoot this missing value problem

2021-06-19 Thread Sean Liao
You're accessing .SecondKS when it should be .Shortcut.SecondKS (as you correctly do for .Shortcut.FirstKS) https://play.golang.org/p/Jzxws3JaTSQ side note: I think it's easier to read if you also use indenting in your templates and use `{{- -}}` to trim leading/trailing whitespace On Sunday,

[go-nuts] Re: Fixed channel capacity in NotifyContext function in os/signals package

2021-07-05 Thread Sean Liao
What problem are you trying to solve? It only makes sense for NotifyContext to receive a single signal since a context can only be cancelled once On Monday, July 5, 2021 at 10:17:49 AM UTC+2 erma...@gmail.com wrote: > Sorry about the broken link, here is the line: > > https://github.com/golang/g

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

2021-07-05 Thread Sean Liao
`embed` embeds the files with the path you specified, so if you look into your `static` variable, the files will be available as `files/static/yourfile`. This means there won't be issues with filename collisions etc... if you specify multiple patterns If you want to serve your files in your `fi

[go-nuts] Re: Panic recovery in net/http Server

2021-07-16 Thread Sean Liao
Typically things panic when something goes seriously wrong, leaving no guarantees on the consistency of the system making it unsafe to continue. It's also much easier to never look at your logs to notice a panic than to ignore a crashing server. https://github.com/golang/go/issues/25245 https://

[go-nuts] Re: install klog error

2021-08-03 Thread Sean Liao
see https://github.com/kubernetes/klog/issues/241 use github.com/go-logr/logr @ v0.4.0 (which is the version declared by k8s.io/klog/v2) using `-u` to upgrade all of your dependencies including your indirect ones is probably not what you want On Tuesday, August 3, 2021 at 6:13:20 PM UTC+2 zhan.

[go-nuts] Re: Go 1.16.7 and 1.15.15

2021-08-05 Thread Sean Liao
1.15.15 release status: https://github.com/golang/go/issues/47518 1.16.7 release status: https://github.com/golang/go/issues/47519 On Thursday, August 5, 2021 at 12:53:29 AM UTC+2 shan...@gmail.com wrote: > Ok lazyreader (IRC) has discovered that the release has a commit, > relating to a CVE on

[go-nuts] Re: go install an/import/path@revision and /vendor in Go 1.16

2021-08-05 Thread Sean Liao
This is intentional and sort of covered by the statement that no module is considered the main module (where replace directives and vendor dirs take effect) https://github.com/golang/go/issues/40276 has some more context On Thursday, August 5, 2021 at 9:40:03 PM UTC+2 Konstantin Khomoutov wrote

Re: [go-nuts] gofmt error formatting suggestion

2021-08-11 Thread Sean Liao
proposed and declined: https://golang.org/issue/27450 On Wednesday, August 11, 2021 at 11:53:54 AM UTC+2 Ralph Seichter wrote: > * burak serdar: > > > f, err:=os.Open(file); if err!=nil { return err } > > I see no advantage in this kind of formatting. Having separate > statements on separate line

Re: [go-nuts] The behavior of the function variable which points to the struct method

2021-08-11 Thread Sean Liao
Perhaps this section of the spec will help: https://golang.org/ref/spec#Method_declarations > The type of a method is the type of a function with the receiver as first argument So there's only a single copy of the function code, but the argument passed to it is copied >From your original examp

[go-nuts] Re: Working with interfaces

2021-08-14 Thread Sean Liao
An interface describes a set of methods that a type needs to have You can create a variable of the type of the interface and assign instances of other types that satisfy the interface to it var o operations o = circle o.Area() // returns area of circle o = rectangle o.Area() // area of rectangle

Re: [go-nuts] go.sum security error

2021-08-17 Thread Sean Liao
Where did you install `go` from and what's the output of `go env` for both versions? On Tuesday, August 17, 2021 at 8:25:06 AM UTC+2 Igor Chubin wrote: > Thank you for your answers! > > This is definitely not in the cache, because the problem exists everywhere, > including new containers and new

[go-nuts] Re: 'go vet' not finding methods exported in _test.go files?

2021-08-27 Thread Sean Liao
I can't reproduce the error you're seeing either in 1.15 or in later versions with the code you provided On Friday, August 27, 2021 at 10:11:07 AM UTC+2 wji...@gmail.com wrote: > Hi, > > We've recently moved from using 'go tool vet' to 'go vet' (we need to > stick to the Go versions shipped wit

[go-nuts] Re: Logging libraries and standard library compatibility

2021-08-29 Thread Sean Liao
zap for example provides both: RedirectStdLog to capture all output and NewStdLog to produce a preconfigured std log.Logger On Sunday, August 29, 2021 at 8:10:54 AM UTC+2 Amnon wrote: > Yes, this is a massive pain. > > The standard library's log.Logger is not an interface, despite ending in > e

[go-nuts] Re: Installation of go1.17.linux-amd64.tar.gz onto Ubuntu Linux Desktop 20.04.3 LTS failed

2021-08-29 Thread Sean Liao
[e] you shouldn't be including `$` in your command try `/usr/local/go/bin/go version`, if that's 1.17 then you only need to fix your $PATH On Sunday, August 29, 2021 at 10:52:36 AM UTC+2 Brian Candler wrote: > On Sunday, 29 August 2021 at 06:06:00 UTC+1 fajars...@cloudgdrive.com > wrote: > >>

[go-nuts] Re: Where to copy vendor to the go docker builder?

2021-09-01 Thread Sean Liao
If you already ran `go mod vendor` outside of docker then there's no need for multilayer caching COPY . . RUN go build On Thursday, September 2, 2021 at 3:54:54 AM UTC+2 kis...@gmail.com wrote: > I'm trying to make docker build faster for software that are built with > golang > tried to cache

[go-nuts] Re: Printing a slice of structs recursively

2021-09-01 Thread Sean Liao
Try doing it recursively, passing in both the current parent id and indentation level On Thursday, September 2, 2021 at 3:55:01 AM UTC+2 n.erde...@gmail.com wrote: > i need some help with printing a slice of structs which there is a child - > parent relation in the struct. > *type* Emp *struct

Re: [go-nuts] HTTP request matching different endpoint - gorilla mux

2021-09-02 Thread Sean Liao
gorilla/mux tests routes in the order they're added. You can register your shared_data route before the {id} one if you must keep the ambiguous path, though the better option is to not have ambiguous paths in the first place. On Thursday, September 2, 2021 at 6:18:36 PM UTC+2 bse...@computer.org

[go-nuts] Re: Wrong output for (*http.Request).Write with custom io.ReadCloser body

2021-09-17 Thread Sean Liao
This was an intentional change in 1.8 https://github.com/golang/go/issues/20257#issuecomment-299509391 On Friday, September 17, 2021 at 6:45:13 AM UTC+2 dmo...@synack.com wrote: > Hi, when using a custom io.ReadCloser nop as body with method POST, PUT, > PATCH, TRACE or custom then (*http.Reque

[go-nuts] Re: AST: Understanding the differences between functions and methods

2021-09-18 Thread Sean Liao
I believe the Recv field does what you want? On Saturday, September 18, 2021 at 8:20:19 PM UTC+2 tjgur...@gmail.com wrote: > Hi, > > I was working on a tool for internal use where I had to work with the go's > abstract syntax tree specially with the FuncDecls. I wanted to filter the > ast to o

[go-nuts] Re: Where are the golang.org docs on channels?

2021-09-18 Thread Sean Liao
See the concurrency section of the tour: https://tour.golang.org/concurrency/2 And the concurrency section of Effective Go: https://golang.org/doc/effective_go#channels And the Share Memory by Communicating codewalk: https://golang.org/doc/codewalk/sharemem/ Which are all linked from the doc pa

[go-nuts] Re: Unable to handle duplicate cookies

2021-09-23 Thread Sean Liao
net/http.Request.Cookie is a convenience function documented to return a single cookie net/http.Request.Cookies will return all cookies, filtering on that should be pretty easy On Thursday, September 23, 2021 at 10:02:34 AM UTC+2 christoph...@gmail.com wrote: > I implemented a simple web site

[go-nuts] [ANN] pion/webrtc v3.1.0 is released - Pure Go implemenation of WebRTC

2021-09-23 Thread Sean DuBois
https://github.com/pion/webrtc/releases/tag/v3.1.0 This is a project I have been working on for a couple years and finally got a new release out. Would love to chat/answer questions here about Pion or even just WebRTC in general! I am always trying to make WebRTC easier/more accessible. So if

[go-nuts] Re: Go Unit Test Crashes with logrus

2021-09-23 Thread Sean Liao
update your version of golang.org/x/sys On Thursday, September 23, 2021 at 8:23:45 PM UTC+2 Yoram Forscher wrote: > I have a problem running Go unit tests on my laptop. When I run the test > it crashes with SIGSEGV inside logrus. If I set the logging level to a high > level (e.g., FatalLevel),

Re: [go-nuts] go-tour-TH cost

2021-09-27 Thread Sean Liao
The way appengine pricing works is calculated in instances hours per day, so if there are particularly busy days where instances x hours goes over 28 there will be some costs involved, though this may not be clear in the monthly summary. If you want, you can limit the scaling behaviour of appengin

Re: [go-nuts] Loading Certificate and Key from string not file for HTTPs server

2021-10-08 Thread Sean Liao
It's only 3 lines excluding error handling if you just want to use a static string. And you'll likely want to setting up your own http.Server anyway to have control over timeouts (and also your own mux to prevent leaking debug handlers). In practice you may actually want o use crypt/tls.Config.

[go-nuts] Re: TCP max segment size

2021-10-08 Thread Sean Liao
net.TCPConn.SyscallConn exposes the fd which you can use with sycalls On Friday, October 8, 2021 at 7:05:40 PM UTC+2 bjeun...@gmail.com wrote: > Hi, > > looking at the net package of the standard library, I don't see a way to > set the tcp max segment size. Surely, one can create a tcp connecti

[go-nuts] Re: Testing: what's the difference between package x and x_test?

2021-10-08 Thread Sean Liao
>From https://pkg.go.dev/cmd/go#hdr-Test_packages > Test files that declare a package with the suffix "_test" will be compiled as a separate package, and then linked and run with the main test binary. Practically, this means no access to unexported things in the package On Friday, October 8, 2

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

2021-10-10 Thread Sean Liao
import _ "embed" It means to import it for side effects only On Sunday, October 10, 2021 at 6:12:07 PM UTC+2 sunto...@gmail.com wrote: > Hi, > > I'm having problem using embed with Go 1.16. I'm getting ether > > - //go:embed only allowed in Go files that import "embed" > - or imported and not us

[go-nuts] Re: x/crypto/openpgp missing support for uncompressed data in compressed data packets

2021-10-17 Thread Sean Liao
Note as of https://github.com/golang/go/issues/44226 x/crypto/openpgp is frozen and deprecated On Saturday, October 16, 2021 at 9:01:42 PM UTC+2 arud...@stripe.com wrote: > Hello, > > I think I may have found a bug in the x/crypto/openpgp implementation. > However, I wanted to ask here to make

[go-nuts] Re: Amateur's questions about "Go lang spec"

2021-10-28 Thread Sean Liao
There isn't much to it, a "production_name" is just an identifier for the set of values defined on the other side of the =, some of which may also be identifiers that should be dereferenced/expanded If it helps, there's a wikipedia entry on it: https://en.wikipedia.org/wiki/Extended_Backus%E2%8

Re: [go-nuts] Various questions about posts from The Go Blog

2021-10-30 Thread Sean Liao
Technically that behaviour is still available via GO111MODULE=auto. Go 1.16 changed the default from "auto" to "on". On Saturday, October 30, 2021 at 11:17:05 PM UTC+2 kziem...@gmail.com wrote: > Hello, > > I don't have energy today to read Go language spec or learning how UTF-8 > works, so I de

Re: [go-nuts] Various questions about posts from The Go Blog

2021-11-08 Thread Sean Liao
SS when using the first version of our Hello() >> function, it FAILS with the second. >> >> According to description quote.Hello() ( >> https://pkg.go.dev/rsc.io/quote#Hello), but from source code we know >> that in fact it returns a string returned by

[go-nuts] Re: Correct usage of Google Api Client

2021-11-08 Thread Sean Liao
svc, err := indexing.NewService() res, err := svc.UrlNotifications.Publish(&indexing.UrlNotification{ /* things in here */ }).Do() On Monday, November 8, 2021 at 6:59:31 PM UTC+1 ladonkin...@gmail.com wrote: > Hi, > > I'm new to Golang so sorry if the question seems stupid. > > I'm trying to inf

[go-nuts] Re: compile time error vs runtime crash for same array

2021-11-13 Thread Sean Liao
global variables are stored in there data section of the compiled binary, the linker imposes a 2GB size limit the array in main can be allocated at runtime, and given enough memory, it could succeed On Saturday, November 13, 2021 at 5:46:29 PM UTC arthurwil...@gmail.com wrote: > On a 64bit Ma

[go-nuts] Re: Trying to code an observer pattern or a publish/submit pattern for a cellular automaton

2021-11-14 Thread Sean Liao
that's exponential growth, every value results in 2 output values input "1" x1, get "2" x2, "3" x4, "4" x8, "5" x16, ... also your use of goroutines to send mean you'll still run out of memory at some point On Sunday, November 14, 2021 at 2:29:26 PM UTC Serge Hulne wrote: > Hi, > > I am trying t

  1   2   3   >