Re: [go-nuts] go doc broken in official go repo

2024-07-18 Thread 'Sean Liao' via golang-nuts
the bootstrap version only allows you to build enough of the compiler for it to run and build the rest of the distribution. you should be using the go binary built from the given source tree when interacting with it. - sean On Thu, Jul 18, 2024, 22:25 will@gmail.com wrote: > I clo

Re: [go-nuts] gomobile: weird dependency on dmitri.shuralyov.com/gpu/mtl

2024-07-17 Thread 'Sean Liao' via golang-nuts
x/mobile isn't just for bindings, it also has some support for more full fledged apps, see https://pkg.go.dev/golang.org/x/mobile/app It seems natural to require some rendering support for that. - sean On Wed, Jul 17, 2024 at 4:42 PM Alvaro Crespo wrote: > > Hi! > > Sadly, "go

Re: [go-nuts] net/http: no Client API to close server connection based on Response #21978

2024-04-02 Thread 'Sean Liao' via golang-nuts
mails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/34d597cf-a84c-48eb-b555-537a8768f468n%40googlegroups.com > <https://groups.google.com/d/msgid/golang-nuts/34d

Re: [go-nuts] Failed to compile a generic code using embedded struct

2024-02-26 Thread 'Sean Liao' via golang-nuts
see https://go.dev/issue/51183 - sean On Mon, Feb 26, 2024, 15:44 Albert Widiatmoko wrote: > Hi Go community, > > I was playing with Go generics and writing some codes, but I faced some > problems. I want to ask questions and help from the community if possible. > Below, I am

Re: [go-nuts] Could we trade all the `ctx context.Context` arguments for one pointer in `g`?

2024-02-21 Thread 'Sean Liao' via golang-nuts
https://go.dev/issue/21335 - sean On Wed, Feb 21, 2024, 00:36 Sam Vilain wrote: > Alright, well thanks for your input. > > I do think these questions can be answered; exploring the use cases in a > proposal format should hopefully show that the impact of closures would no

Re: [go-nuts] heap ballast

2024-02-12 Thread 'Sean Liao' via golang-nuts
The modern way to handle this is with GOMEMLIMIT https://tip.golang.org/doc/gc-guide - sean On Mon, Feb 12, 2024 at 8:33 PM Mike Mitchell wrote: > > Purely for the sake of experiment (this is not a production environment > thing), I have tried to test out the Heap Ballast technique of

Re: [go-nuts] Re: 1.22.0 ServeMux HandleFunc infinite loop

2024-02-08 Thread 'Sean Liao' via golang-nuts
I've filed it as https://go.dev/issue/65624 - sean On Thu, Feb 8, 2024 at 6:58 PM Kyle Shannon wrote: > > On 2/8/24 11:30, Jason Phillips wrote: > > Can you create a small self-contained program that reproduces the issue? The > following program returns 404 locally, as I'd expec

Re: [go-nuts] <-ctx.Done() panic

2024-01-03 Thread 'Sean Liao' via golang-nuts
maybe a bad custom context implementation in the chain - sean On Wed, Jan 3, 2024, 10:57 cheng dong wrote: > i have a program paniced with > > ``` > runtime.deferCallSave(0xc0313d56d8, 0xc0401839e8?) > /home/ubuntu/go/go1.19.5/src/runtime/panic.go:796 +0x88 >

Re: [go-nuts] https client 403 error

2023-12-29 Thread 'Sean Liao' via golang-nuts
see https://pkg.go.dev/net/http#Client.Jar - sean - sean On Fri, Dec 29, 2023 at 6:53 PM vlya...@gmail.com wrote: > > I use generic https client code to perform GET: > tr := { TLSClientConfig: {InsecureSkipVerify: > true}, } > client := { Transport: tr, } > req, err

Re: [go-nuts] Re: custom slog Handler which adds Attribute and WithGroup

2023-10-23 Thread 'Sean Liao' via golang-nuts
, but you lose any preformatting performance benefits a handler may have implemented.) - sean On Mon, Oct 23, 2023 at 2:50 PM Johann Höchtl wrote: > As I got zero reply to that answer, let me rephrase it probably more > easily: > > I would like to use slog, no other logging library &g

Re: [go-nuts] Re: Weird error when trying to fetch a module.

2023-09-15 Thread 'Sean Liao' via golang-nuts
github.com/google/flatbuffers v22.11.23+incompatible - sean On Fri, Sep 15, 2023 at 4:35 PM Bruno Albuquerque wrote: > So, I am still curious about something. Flatbuffers, which is a project I > depend on, does have its go code in a subdirectory and I can go get it: > > ➜ ~ go get -

Re: [go-nuts] Re: [slog] customize defaultHandler

2023-08-29 Thread 'Sean Liao' via golang-nuts
cycle: https://go.dev//issues/61892 default handler, copied/exported: https://pkg.go.dev/github.com/jba/slog/handlers/loghandler - sean On Tue, Aug 29, 2023 at 7:53 AM Marcello H wrote: > Yesterday, I came up with the same question and found this: > "github.com/lmi

Re: [go-nuts] How to be a good slog module?

2023-08-23 Thread 'Sean Liao' via golang-nuts
start. Personal preference is for 1, and whether you take a Logger vs Handler would just be if you have a preference for a different frontend. - sean On Wed, Aug 23, 2023 at 7:09 PM TheDiveO wrote: > Up front, I admit my sin of arrogance in giving structured logging the > slip thes

Re: [go-nuts] Re: Using underscore in return statements - a small convenience idea

2023-08-23 Thread 'Sean Liao' via golang-nuts
see also: https://go.dev/issues/19642 https://go.dev//issues/21182 - sean On Wed, Aug 23, 2023 at 3:10 PM Nick Craig-Wood wrote: > Ah ha! I thought there would be a related issue I couldn't find :-) > > `zero` would remove most of the pain though IMHO `_` looks neater in the

Re: [go-nuts] possible bug in slogtest or ReplaceAttr

2023-08-18 Thread 'Sean Liao' via golang-nuts
please file it as a bug for jsonhandler - sean On Fri, Aug 18, 2023, 21:17 jal...@gmail.com wrote: > Hi all, > > In slog, I am experimenting with the the ReplaceAttr func in the > HandlerOptions with json handler. My understanding is that if i want to > remove an attribute then

Re: [go-nuts] Is go test the wrong tool to use for a pure test harness?

2023-08-13 Thread 'Sean Liao' via golang-nuts
you can compile a test binary with `go test -c` and execute it later - sean On Sun, Aug 13, 2023, 18:28 dave bronte wrote: > Forgive me for what might at first glance look like a provocative subject > line - it's not meant to be. > > The team that I work in has been asked to deve

Re: [go-nuts] How to minimize RAM usage during Go binary compilation

2023-07-12 Thread 'Sean Liao' via golang-nuts
considering it is primarily static information, maybe it should be passed in and as data during run time, instead of being embedded and compiled as code? - sean On Wed, Jul 12, 2023, 13:18 Jason Kulatunga wrote: > Hi, > > I’m doing something a bit unusual with my application and I

Re: [go-nuts] comment.Printer.DocLinkURL isn't being called

2023-07-09 Thread 'Sean Liao' via golang-nuts
your parsing setup is missing the lookup to identify which things are actually linkable symbols https://go.dev/play/p/sDtGA_JJZdz - sean On Sun, Jul 9, 2023, 23:45 will@gmail.com wrote: > I'm trying to print the Markdown for package documentation using the new > go/doc/comment p

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

2023-06-03 Thread 'Sean Liao' via golang-nuts
It is not a typo https://go.dev/issue/24451 - sean On Sat, Jun 3, 2023 at 10:05 PM peterGo wrote: > It's a simple typo. Send in a fix. > > peter > > On Saturday, June 3, 2023 at 4:07:15 PM UTC-4 Kamil Ziemian wrote: > >> As burak serdar said, 9 = 3 * 3 is not a

Re: [go-nuts] Importing a package declared in the root directory of a module

2023-04-15 Thread 'Sean Liao' via golang-nuts
the import path specifies the location to find a package, but the actual identifier used is the one in the package declaration, so import "a_module_path" var foo = util.Foo - sean On Sat, Apr 15, 2023, 20:40 Victor Giordano wrote: > Thanks *Sean!!* > That makes sense for me!

Re: [go-nuts] Importing a package declared in the root directory of a module

2023-04-15 Thread 'Sean Liao' via golang-nuts
import "a_module_path" optionally rename it to make it clearer import util "a_module_path" - sean On Sat, Apr 15, 2023, 20:31 Victor Giordano wrote: > Hi there! > > I was playing a little bit with modules and packages, regarding making > projects. > And I

Re: [go-nuts] Is there a golang download for latest patch release like 1.20.x?

2023-03-30 Thread 'Sean Liao' via golang-nuts
What page are you looking at? https://go.dev/dl/ - sean On Thu, Mar 30, 2023 at 6:17 PM silverwind wrote: > Is there a way to download the latest patch release of golang 1.20 which > currently is at 1.20.2. On the available downloads, I only find explicit > links: > > ht

Re: [go-nuts] Redfining loop variable semantics - what's the plan?

2023-03-25 Thread 'Sean Liao' via golang-nuts
https://go.dev/issue/57969 - sean On Sat, Mar 25, 2023, 06:45 Amnon wrote: > Hi Gophers, > Last year there was a discussion about removing one of the > more common gotchas in Go. > > To quote from the discussion: > > the problem is that loops like this one don’t d

Re: [go-nuts] Minor Omission in List on https://pkg.go.dev/golang.org/x

2023-03-10 Thread 'Sean Liao' via golang-nuts
https://go.dev/issue/56482 - sean On Sat, Mar 11, 2023 at 7:35 AM Ian Lance Taylor wrote: > On Fri, Mar 10, 2023 at 2:54 PM jlfo...@berkeley.edu > wrote: > > > > Shouldn't "term" be included in the list shown on > https://pkg.go.dev/golang.org/x? > > >

Re: [go-nuts] "go test": common prefix for errors

2023-03-10 Thread 'Sean Liao' via golang-nuts
implementing a helper/wrapper on your side might be easier, I believe most helpers take the TB interface rather than the concrete T type. also it sounds more like a failure of the application to separate its output streams properly. -- You received this message because you are subscribed to the

Re: [go-nuts] Re: heap profiling does not work on M2 MacBook air?

2023-03-01 Thread 'Sean Liao' via golang-nuts
.31kB 100% regexp/syntax.Compile 0 0% 100% 513.31kB 100% runtime.doInit 0 0% 100% 513.31kB 100% runtime.main 0 0% 100% 513.31kB 100% seehuhn.de/go/pdf/font/tounicode.init - sean On Wed, Mar 1, 2023 at 11:25 PM Jochen Voss wrote: >

Re: [go-nuts] Go 1.20 "cold start" slows down CI pipeline stages due to first building stdlib

2023-02-16 Thread 'Sean Liao' via golang-nuts
- restore cache (go version as cache key) - go build std - save cache (GOCACHE) - original build steps follow here - sean On Thu, Feb 16, 2023, 19:54 TheDiveO wrote: > As Go 1.20 doesn't ship anymore with prebuild stlib packages, the first > build after installation will take longer. Obv

Re: [go-nuts] GOPATH, GOBIN, go install, go build, cross-compiles

2023-01-20 Thread 'Sean Liao' via golang-nuts
combination with GOFLAGS, now that quoting is allowed after https://go.dev/issue/26849 - sean On Fri, Jan 20, 2023 at 7:30 PM Tim Hockin wrote: > Thanks Sean. > > On Fri, Jan 20, 2023 at 10:39 AM 'Sean Liao' via golang-nuts > wrote: > > > > in module mode, > > GOPAT

Re: [go-nuts] GOPATH, GOBIN, go install, go build, cross-compiles

2023-01-20 Thread 'Sean Liao' via golang-nuts
ulting executables > will be written to that directory. - sean On Fri, Jan 20, 2023 at 5:30 PM 'Tim Hockin' via golang-nuts < golang-nuts@googlegroups.com> wrote: > I'm trying to make kubernetes' codebase easier to navigate by people who > have muscle-memory for go. In the past we said

Re: [go-nuts] Re: App Engine hasn't upgraded beyond Go 1.16, which is now out of security window

2022-12-19 Thread Sean Abraham
fixes anymore, and App Engine Go users are in a frustrating place. >>>> >>>> If this is App Engine's way of telling me to move to Cloud Run >>>> (-->Dockerizing), it'd be nice if they'd just tell us that :). Otherwise, >>>> could a Googl

Re: [go-nuts] Is OCSP Stapling supported in Go? If so, how?

2022-12-19 Thread 'Sean Liao' via golang-nuts
The standard library itself doesn't do it, but it does provide you with hooks to do so. Set crypto/tls.Config.GetCertificate to an appropriate implementation of OCSP stapling. Examples of ocsp stapling can be found via the package discovery site: https://pkg.go.dev/search?q=ocsp+staple - sean

Re: [go-nuts] the example always fails if the string contains a trailing space before a newline

2022-12-19 Thread 'Sean Liao' via golang-nuts
https://go.dev/issue/26460 - sean On Mon, Dec 19, 2022 at 7:31 PM David M wrote: > Not quite sure if this is a bug but it's annoying: > > If the example tested string contains a trailing space before a newline, > the test always fails no matter how. > // this test passes >

Re: [go-nuts] Refresher tutorial

2022-12-10 Thread 'Sean Liao' via golang-nuts
consider something like https://learnxinyminutes.com/docs/go/ if you just need a brief refresher on syntax/core concepts - sean On Sat, Dec 10, 2022, 17:17 Ken wrote: > Hi, when I first learned golang, there was a nice tutorial avaiable. I’m > in need of a refresher as I haven’

Re: [go-nuts] HTTPS proxy issue using CONNECT method

2022-12-03 Thread 'Sean Liao' via golang-nuts
How are you setting the proxy? - sean On Sat, Dec 3, 2022, 16:46 Mauro Monteiro wrote: > Hello all, > > I have been facing an issue when I try to create a HTTP client which needs > to connect through a HTTPS proxy using the HTTP CONNEC method. I know that > it can be achieved

Re: [go-nuts] go install of forked repo

2022-12-03 Thread 'Sean Liao' via golang-nuts
`go install pkg@version` doesn't support installing from a fork. The argument is best understood as a module identity rather than source code location. - sean On Sat, Dec 3, 2022, 11:55 Duncan Harris wrote: > This seems a noddy question but can't easily find an answer with Google > appa

Re: [go-nuts] Re: gRPC for web applications with millions of users

2022-12-02 Thread 'Sean Liao' via golang-nuts
See also https://buf.build/blog/connect-web-protobuf-grpc-in-the-browser - sean On Fri, Dec 2, 2022 at 4:46 PM Brian Candler wrote: > Just checking that you came across this already? > https://grpc.io/blog/state-of-grpc-web/ > > gRPC can't be implemented natively in browsers. You

Re: [go-nuts] Fetch pseudo-versions

2022-12-02 Thread 'Sean Liao' via golang-nuts
all pseudoversions would be a list of all commits are you sure that's what you want? - sean On Fri, Dec 2, 2022, 16:37 Marco Augusto Vitangeli < marcoaugustovitang...@gmail.com> wrote: > Hi, this question is a little bit weird, but for a project I need to list > all versions of a go

Re: [go-nuts] where is GOROOT set?

2022-11-23 Thread 'Sean Liao' via golang-nuts
output of `go env` please - sean On Wed, Nov 23, 2022 at 11:25 PM pat2...@gmail.com wrote: > I've separated my code into separate subdirectories, added a go.mod > ran go mod tidy on each. > > I'm mostly back where I started, which a better source file tree > > I'm trying to

Re: [go-nuts] Re: is this a bug in "go fmt"?

2022-11-11 Thread 'Sean Liao' via golang-nuts
/ +build production,linux package main ``` - sean On Fri, Nov 11, 2022 at 9:13 PM Sandeep Kalra wrote: > and similar issue with other style of adding tags as well > > i.e. > // +build tag1,tag2 > // +build tag1 tag2 > etc > > On Friday, November 11, 2022 at 3:07

Re: [go-nuts] [ANN] Tool for automatic instrumentation of OpenTelemetry

2022-11-10 Thread 'Sean Liao' via golang-nuts
Interesting As a note, directive comments should be of the form `//toolname:directive`, meaning the `//go:` prefix should be reserved for the `go` toolchain itself. - sean On Thu, Nov 10, 2022 at 4:07 PM Nikolay Dubina wrote: > *What?* > > Tool for automatic instrumentation of Open

Re: [go-nuts] Error Interfaces

2022-11-05 Thread Sean Foley
If the error is created by your code, then just reuse the same one. See https://cs.opensource.google/go/go/+/refs/tags/go1.19.3:src/io/io.go;drc=90b40c0496440fbd57538eb4ba303164ed923d93;l=44 If the error is created by code other than your own, and that code does not reuse the same error, then

Re: [go-nuts] Re: behavior of %f

2022-10-10 Thread 'Sean Liao' via golang-nuts
> leaving one with the impression those digits will be as they are in the float, and not rounded. This is a fundamental misunderstanding of what a float is. The rounding happens the moment a value is stored in a float. The printed value is exactly what is stored. - sean -- You recei

Re: [go-nuts] Internationalized webpage depending on the user's web browser locale

2022-10-10 Thread 'Sean Liao' via golang-nuts
.Lang comes from something gitea provided to the template, it's not an intrinsic part of go - sean On Mon, Oct 10, 2022, 19:48 Christoph wrote: > Hello, > > I am running a git-server, powered by gitea, an open-source git server > project written in Go. In gitea, it is possible

[go-nuts] Pure Go implementation of the Opus audio Codec

2022-10-03 Thread Sean DuBois
Hello Gophers, I am excited to share [0] it is a Pure Go implementation of the Opus[1] audio codec. It has a long way to go still, but is far enough long that contributors and users should find it useful! If you have ever done web conferencing, watched YouTube or played a video games you have

Re: [go-nuts] Error-checking with errors.As() is brittle with regards to plain vs pointer types

2022-09-22 Thread 'Sean Liao' via golang-nuts
The documented api includes > An error matches target if the error's concrete value is assignable to the value pointed to by target *T is not assignable to T - sean On Wed, Sep 21, 2022, 20:26 cpu...@gmail.com wrote: > Consider https://go.dev/play/p/jgPMwLRRsqe: > > e

[go-nuts] Re: Getting 410 error from https://sum.golang.org/lookup/github.com for a private github repo

2022-09-19 Thread Yoon Sean
Thank you very much. You save me from this issue. 2020년 5월 28일 목요일 오전 10시 46분 28초 UTC+7에 ghost.m...@gmail.com님이 작성: > You may try: > > export *GONOSUMDB*="github.com/mycompany/*,github.com/secret/*" > > to disable sum check for some libraries. But try **not** to do this: > > > $export

[go-nuts] App Engine hasn't upgraded beyond Go 1.16, which is now out of security window

2022-09-11 Thread Sean Abraham
? I don't know where to file a bug straight against AE, and I figure the Go team should be very interested in this, due to aforementioned security implications. https://cloud.google.com/appengine/docs/standard/go/release-notes Thanks, Sean -- You received this message because you are subscri

Re: [go-nuts] Detachable context.Context?

2022-09-03 Thread 'Sean Liao' via golang-nuts
https://go.dev/issue/40221 - sean On Sat, Sep 3, 2022, 16:56 Alex Besogonov wrote: > Hi! > > Let me give you some context. context.Context in Go serves two main > purposes: > 1. Cancellation and timeout support. > 2. A carrier of values, as a de-facto replacement for thread

Re: [go-nuts] How to cross-compile Go 1.19 compiler for Solaris 11 on Linux

2022-09-01 Thread 'Sean Liao' via golang-nuts
That's a known issue, see: https://go.dev/issue/53813 https://go.dev/issue/54197 - sean On Wed, Aug 31, 2022, 21:35 Shane wrote: > I was finally able to compile the bootstrap on Linux (I had to install the > missing libc). > > However, after copying the .tbz file onto my Solari

Re: [go-nuts] How to cross-compile Go 1.19 compiler for Solaris 11 on Linux

2022-08-27 Thread 'Sean Liao' via golang-nuts
make.bash calls cmd/dist which does the build chaining, calling it directly doesn't skip the process. - sean On Sat, Aug 27, 2022, 19:54 Shane wrote: > > Is there some way I can skip straight to building Go for my Solaris > target using my existing Linux Go tools? > Sorry, t

Re: [go-nuts] How to cross-compile Go 1.19 compiler for Solaris 11 on Linux

2022-08-27 Thread 'Sean Liao' via golang-nuts
. Where it fails is the (optional) cgo part, you'll want to fix that before attempting to cross compile. - sean On Sat, Aug 27, 2022, 18:16 Shane wrote: > I noticed bootstrap.bash just calls make.bash here > <https://go.googlesource.com/go/+/refs/tags/go1.19/src/bootstrap.bash#61>, >

Re: [go-nuts] Client Cipher Order Preference not being honored with golang 1.17+

2022-08-26 Thread 'Sean Liao' via golang-nuts
answer. - sean On Fri, Aug 26, 2022, 04:23 'Diana Tuck' via golang-nuts < golang-nuts@googlegroups.com> wrote: > I guess I need to clarify what I was trying to say here - golang 1.17+ > claims that TLS_RSA_WITH_AES_128_GCM_SHA256 is more secure than > TLS_ECDHE_RSA_WITH_AES_128

Re: [go-nuts] Re: Some confusion about escape analysis

2022-08-26 Thread Sean Foley
Perhaps it will have a small benefit. However, according to the benchmark, the performance is slightly better in the case where there is 1 alloc/op, Normally people avoid the heap allocation for better performance and there is no evidence of that here. On Fri, Aug 26, 2022 at 3:32 AM Lee Chou

Re: [go-nuts] Client Cipher Order Preference not being honored with golang 1.17+

2022-08-25 Thread 'Sean Liao' via golang-nuts
This is intentional, see https://go.dev/issue/45430 - sean On Thu, Aug 25, 2022, 19:07 'Diana Tuck' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Since upgrading to 1.17 in which the cipher order is determined by the > golang lib, clients that previously negotiated with

[go-nuts] Re: Some confusion about escape analysis

2022-08-25 Thread Sean Foley
Actually, looking more closely at your benchmark numbers, the trick does not work in your case. Which makes sense to me, I don't see why it would work. On Wednesday, August 24, 2022 at 2:59:34 AM UTC-4 mozart...@gmail.com wrote: > I was try using net.Buffers for writev. But I meet a

[go-nuts] Re: Some confusion about escape analysis

2022-08-25 Thread Sean Foley
That trick was copied from here: https://cs.opensource.google/go/go/+/refs/tags/go1.19:src/strings/builder.go;l=26 See https://github.com/golang/go/issues/23382 and https://github.com/golang/go/issues/7921 I don't know why the trick works in your case. It appears to be safe. On Wednesday,

[go-nuts] Re: Some confusion about escape analysis

2022-08-25 Thread Sean Foley
That trick was copied from here: https://cs.opensource.google/go/go/+/refs/tags/go1.19:src/strings/builder.go;l=26 See https://github.com/golang/go/issues/23382 and https://github.com/golang/go/issues/23382 and https://github.com/golang/go/issues/7921 I don't know why the trick works in your

Re: [go-nuts] Does the Mutex.TryLock has the race issue?

2022-08-25 Thread Sean Foley
The type does not need to be Int32 because the Compare-and-Swap operation works on int32. It is fine as is. The compare-and-swap operation provided by the hardware guarantees that the compare-and-swap operation is atomic, which means no other read operation by any other goroutine will see the

Re: [go-nuts] Go multiplexers

2022-08-20 Thread 'Sean Liao' via golang-nuts
yamux uses its own protocol, it doesn't speak telnet - sean On Sat, Aug 20, 2022, 21:31 ramki...@hotmail.com wrote: > Has anyone ever used a multiplexer <https://github.com/hashicorp/yamux>? > When creating a TCP server using multiplexer, I get an error [ERR] yamux: > Invalid p

Re: [go-nuts] Re: Generic error handling with panic, recover, and defer

2022-07-29 Thread 'Sean Liao' via golang-nuts
or https://github.com/dsnet/try - sean On Fri, Jul 29, 2022, 23:01 Nathaniel Lehrer wrote: > This is similar, maybe this one is better to use? > https://github.com/lainio/err2 > > On Tuesday, September 21, 2021 at 1:57:38 PM UTC-7 mces...@gmail.com > wrote: > >&g

Re: [go-nuts] ListenAndServeTLS() (pem and key files for private network)

2022-06-30 Thread 'Sean Liao' via golang-nuts
icates by demonstrating control, if you run your own compatible CA in within your private network, you can do this without leaking information to the public. Unless you wish to distribute each self signed certificate to every client, by definition they cannot be trusted by default. - sean -

Re: [go-nuts] Query regarding net/http/cookiejar: Cookies() method and Expiry/MaxAge

2022-06-29 Thread 'Sean Liao' via golang-nuts
Implement your own cookie jar, See also: https://github.com/golang/go/issues/19291#issuecomment-282576908 - sean On Wed, Jun 29, 2022 at 11:31 PM Amit Saha wrote: > Hi all, > > Currently the Cookies() method as explained at > https://pkg.go.dev/net/http/cookiejar#Jar.Cooki

Re: [go-nuts] defer func running timing

2022-06-25 Thread 'Sean Liao' via golang-nuts
Maybe it's clearer if you look at what's happening like this https://go.dev/play/p/jAia9OPJfbY The arguments to defer are evaluated immediately, but the execution only happens later - sean On Sat, Jun 25, 2022, 21:40 Lee Chou wrote: > Hello, > > https://go.dev/play/p/J1tVplkIrjt &

Re: [go-nuts] godoc and 1.19 "Doc links"

2022-06-25 Thread 'Sean Liao' via golang-nuts
I believe the answer is using godoc That would be a correct link if you used pkgsite godoc is deprecated as of https://github.com/golang/go/issues/49212 - sean On Sat, Jun 25, 2022, 20:54 TheDiveO wrote: > Using go1.19beta1 I installed godoc using "go1.19beta1 install > golang.org/

Re: [go-nuts] How does Go runtime decide minimum number of threads?

2022-06-20 Thread 'Sean Liao' via golang-nuts
from runtime: > The GOMAXPROCS variable limits the number of operating system threads that can execute user-level Go code simultaneously. There is no limit to the number of threads that can be blocked in system calls on behalf of Go code; those do not count against the GOMAXPROCS limit. - s

Re: [go-nuts] Help with sync.Cond failing to signal

2022-06-11 Thread 'Sean Liao' via golang-nuts
one to either missed or spurious signals [citation needed] - sean On Sat, Jun 11, 2022 at 3:27 PM Kevin Burke wrote: > Hi, > Recently I inherited some code in production that was hitting an error > case that I didn't think should be possible to hit. I reduced it down to > this test ca

Re: [go-nuts] unrecognized import path "code.google.com/p/go.crypto/openpgp"

2022-06-10 Thread 'Sean Liao' via golang-nuts
Note that x/crypto/openpgp has been frozen and deprecated, you're better off with a third party maintained package - sean On Fri, Jun 10, 2022, 00:41 'Dan Kortschak' via golang-nuts < golang-nuts@googlegroups.com> wrote: > On Thu, 2022-06-09 at 14:21 -0700, Peter Sjolin wrote: > &

Re: [go-nuts] Functions vs Methods: explain reasoning behind STD

2022-06-02 Thread 'Sean Liao' via golang-nuts
the second version anyway, especially if there are multiple types that expose similar functionality ref: https://go.dev/ref/spec#Method_expressions - sean On Thu, Jun 2, 2022 at 3:38 PM Deividas Petraitis wrote: > Background: when I am writing code mostly I end up with some clunky > solution

[go-nuts] I cannot get rid of false and misleading "go to latest" button on pkg.go.dev

2022-05-28 Thread Sean Foley
Hello all, If you go to my module https://pkg.go.dev/github.com/seancfoley/ipaddress-go then everything looks fine. when you go to a subfolder https://pkg.go.dev/github.com/seancfoley/ipaddress-go/ipaddr it things that a pseudo-version is the latest, not the correct version 1.2.0. When you

Re: [go-nuts] uber handler to collect stacktrace when program crashing

2022-05-28 Thread 'Sean Liao' via golang-nuts
I believe this is asking for a single handler that will apply to all goroutines, to which the answer is no such feature exists - sean On Sat, May 28, 2022, 03:09 Ian Lance Taylor wrote: > On Fri, May 27, 2022 at 10:42 AM Aggarwal Sre > wrote: > > > > Is there a recommend

Re: [go-nuts] Re: Installing a package with an associated command

2022-05-25 Thread 'Sean Liao' via golang-nuts
`go install github.com/your/repo/cmd/...@latest` should work replace `latest` with specific versions (eg prereleases) if necessary - sean On Wed, May 25, 2022, 08:50 christoph...@gmail.com < christophe.mees...@gmail.com> wrote: > Indeed, it works. What if there are multiple binaries t

Re: [go-nuts] encoding/json doesn't find marshal/unmarshal via type aliases

2022-05-20 Thread 'Sean Liao' via golang-nuts
As explained above, `type AliasedDate Date` clears any methods you have defined on `Date`. But `Date` embeds `time.Time` which has its own `UnmrshalJSON`, which now gets promoted. So `Date.UnmsrshalJSON` calls your `UnmsrshalJSON` `AliastedDate.UnmsrshalJSON` calls

Re: [go-nuts] OAuth2 HttpClient customizable header

2022-05-18 Thread 'Sean Liao' via golang-nuts
'Patrick Kaeding' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Thanks Sean! > > I just realized I cited the wrong package in my earlier message. I meant > to refer to the golang.org/x/oauth2/clientcredentials client. I'm not > sure if that matters for the discussion, bu

Re: [go-nuts] OAuth2 HttpClient customizable header

2022-05-18 Thread 'Sean Liao' via golang-nuts
doesn't sound like a common use case, might be easier to use a transport that moves the header? - sean On Wed, May 18, 2022, 19:52 'Patrick Kaeding' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Would it be possible to allow the [header that is used]( > https://githu

Re: [go-nuts] Crypto/tls: Get further information on established TLS connection

2022-05-09 Thread 'Sean Liao' via golang-nuts
tls.Conn.ConnectionState().PeerCertificates - sean On Mon, May 9, 2022, 16:59 J. Pecholt wrote: > Hi there, > I am trying to perform further authentication operations based on an > existing tls.Conn without modifying the package/module itself because of > portability and security r

Re: [go-nuts] Refactor to use generics to have a single Make

2022-05-03 Thread 'Sean Liao' via golang-nuts
right now it only works if the structs are actually identical: https://go.dev/play/p/tMG3SYG5fLN - sean On Tue, May 3, 2022 at 8:06 PM sbezverk wrote: > Hello, > > > > I am starting to learn generics and I was wondering if the following code > could be refactored to use

Re: [go-nuts] Re: testing examples printing to stdout not working for global var

2022-05-02 Thread 'Sean Liao' via golang-nuts
Code needs to be written to be testable. Peter is correct, you've taken a reference to an uninstrumented os.Stdout. What you've written isn't identical wrt to the evaluation of stdout, so can't be expected to perform identically. -- You received this message because you are subscribed to the

Re: [go-nuts] What is the Go build cache for fuzz testing?

2022-04-27 Thread 'Sean Liao' via golang-nuts
testdata/fuzz is for inputs that have caused a failure and you want to keep around so that they are ~always run, to prevent regressions. -fuzzcache is more like a log of useful things it has tried, so it doesn't waste resources going over the same/similar inputs see `go help cache` - sean

Re: [go-nuts] Advice for closed network - problem with go mod

2022-04-25 Thread 'Sean Liao' via golang-nuts
See https://go.dev/ref/mod#environment-variables GOPROXY=file://$(go env GOMODCACHE)/cache/download - sean On Mon, Apr 25, 2022 at 10:08 PM David Arsenault wrote: > Hello. I was hoping to get some smart advice on a problem using go on a > closed network. > > Summary: > -

Re: [go-nuts] Using an "internal" repo or org vs. vendor

2022-04-25 Thread 'Sean Liao' via golang-nuts
Back in 2016 the decision was "working as intended", ref: https://github.com/golang/go/issues/16622#issuecomment-255391314 - sean On Mon, Apr 25, 2022 at 5:58 PM 'Tim Hockin' via golang-nuts < golang-nuts@googlegroups.com> wrote: > We have some packages we woul

Re: [go-nuts] Tool to check binaries for vulnerabilities

2022-04-15 Thread 'Sean Liao' via golang-nuts
If you only need to target 1.18+, you can use `debug/buildinfo.ReadFile` which doesn't require shelling out to go On Fri, Apr 15, 2022 at 7:03 AM Zhaoxun Yan wrote: > That sounds great! Thanks. > > 在2022年4月15日星期五 UTC+8 05:55:27 写道: > >> On Thu, 2022-04-14 at 03:05 -0700, Michel Casabianca

Re: [go-nuts] io.WriteString to a file panics

2022-04-12 Thread 'Sean Liao' via golang-nuts
> output, err := os.Create(o) The short variable declaration you used to create `err` also shadows `output`. var err error output, err = os.Create(o) On Tue, Apr 12, 2022 at 8:53 AM Rory Campbell-Lange wrote: > I have a command line programme that can output to either stdout or a > named

Re: [go-nuts] Allow a TCP connection, but not a TLS connection based on an ACL

2022-03-28 Thread 'Sean Liao' via golang-nuts
if max := 1 * time.Second; tempDelay > max { > tempDelay = max > } > srv.logf("http: Accept error: %v; retrying in %v", err, tempDelay) > time.Sleep(tempDelay) > continue > } > return err >} > > &g

Re: [go-nuts] Allow a TCP connection, but not a TLS connection based on an ACL

2022-03-28 Thread 'Sean Liao' via golang-nuts
I would just add a for loop around your code and only return when you have a connection you want to allow, otherwise just log / pass the error elsewhere. On Mon, Mar 28, 2022 at 11:26 PM John wrote: > I'm looking to satisfy this: > >- If you are in an ACL, you can make a TLS connection >

Re: [go-nuts] GO routine never exits based on stop condition - unable to find the reason

2022-03-28 Thread 'Sean Liao' via golang-nuts
1. your generator never finished 2. your work channel still has things in it, there's no guarantee select will choose done first 3. reading from a closed channel will give you a zero value On Mon, Mar 28, 2022, 16:53 Gowtham Raj wrote: > In this example, we have a *worker*. The idea here is

Re: [go-nuts] Golang Packages

2022-03-16 Thread 'Sean Liao' via golang-nuts
It's available if you use the generated pseudoversion as the version in the pkgsite url . you can get it via a call to go get (which is necessary to populate the proxy for pkgsite). A bit difficult to demonstrate on your module as testbranch right now points to v0.0.1 which takes precedence. On

Re: [go-nuts] debug.ReadBuildInfo is info.Main.Version always "(devel)"

2022-03-16 Thread 'Sean Liao' via golang-nuts
not yet https://github.com/golang/go/issues/50603 -- 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. To view this

Re: [go-nuts] go run strips symbols

2022-03-14 Thread 'Sean Liao' via golang-nuts
go run -ldflags="-s=false" . -- 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. To view this discussion on the web visit

[go-nuts] Re: workspaces tutorial query

2022-03-12 Thread Sean Liao
Fixed on tip ref: https://go.dev/issue/51449 On Saturday, March 12, 2022 at 9:40:04 AM UTC kortschak wrote: > I was just taking a look at the workspaces tutorial and saw that while > the doc says that adding the local example module will result in > > go 1.18 > > use ( > ./hello > ./example > )

[go-nuts] Re: Possible float64 precision problem

2022-03-09 Thread Sean Liao
It would help if your could show the actual code for both C and Go, as well as the input On Wednesday, March 9, 2022 at 11:37:10 AM UTC christoph...@gmail.com wrote: > I'm translating a scientific C program into Go that is doing some 64bit > floating point operations. > > In this process I

[go-nuts] Re: how to solve the go.mod conflict when 2 sub-modules point to break version of a common module

2022-03-07 Thread Sean Liao
Splitting the uses of a/b into their own modules/repo won't work if you ultimately import them into a single module. It would be the same problem, just further down the dependency tree. On Monday, March 7, 2022 at 7:14:17 PM UTC ian.zh...@gmail.com wrote: > > Thanks for your reply. > > It's sad

[go-nuts] Re: how to solve the go.mod conflict when 2 sub-modules point to break version of a common module

2022-03-07 Thread Sean Liao
As a v0.x.y module, it's explicitly signaling that it may introduce incompatible changes between minor versions, as has happened here. unfortunately for you, a module can only exist at a single version within a build, so you'll have to modify your dependencies. Some time ago, OpenTelemetry

[go-nuts] Re: is url->String->Parse != url a bug?

2022-03-04 Thread Sean Liao
Expected, the percent encoded version produced by String() is semantically equivalent and safer than the raw space version, and also doesn't require storing the raw version. On Friday, March 4, 2022 at 1:10:22 PM UTC joche...@gmail.com wrote: > Hello, > > If I convert an url.URL to a string

[go-nuts] Re: Migrating to go modules with package name different from VCS

2022-02-23 Thread Sean Liao
See https://pkg.go.dev/cmd/go#hdr-Remote_import_paths specifically: > The meta tag has the form: > If you serve the meta tags over HTTPS on the package path, you can point it to the appropriate git repo On Wednesday, February 23, 2022 at 2:54:25 PM UTC+1 luxif...@gmail.com wrote: > Hello, >

[go-nuts] Re: go log.Println(http.ListenAndServe(...)) blocks

2022-02-18 Thread Sean Liao
https://go.dev/ref/spec#Go_statements : > The function value and parameters are evaluated as usual in the calling goroutine, but unlike with a regular call, program execution does not wait for the invoked function to complete. http.ListenAndServe is being

[go-nuts] Re: Getting "$GOPATH/go.mod exists but should not" when running build in a Docker image

2022-02-11 Thread Sean Liao
The `golang` container image sets the GOPATH directory to /go and the working directory to /go too. Following GOPATH layout, source code is expected to be in directories under /go/src. `/go/bin` is where binaries are installed by default, and `/go/pkg` include things like the module cache. With

Re: [go-nuts] Why Go allow function with unused arguments?

2022-01-30 Thread Sean Liao
By enforcing blanks, you'd lose the chance to name them something useful to tell the reader why they're ignored. eg: // why are the last 2 args ignored?? handleX = func(foo, bar, _, _ string) string { return foo + bar } On Sunday, January 30, 2022 at 10:21:11 PM UTC+1

Re: [go-nuts] Re: Should dev tools be tracked by go.mod?

2022-01-25 Thread Sean Liao
a problem if your tools introduce a version higher than what your consumer would otherwise have selected. On Monday, January 24, 2022 at 10:45:29 PM UTC+1 sv...@redhat.com wrote: > Hi Sean, > > Thanks a lot for your answer! > > On Mon, Jan 24, 2022 at 9:01 PM Sean Liao wrote: > >

[go-nuts] Re: Should dev tools be tracked by go.mod?

2022-01-24 Thread Sean Liao
As a (hypothetical) consumer of your library, I would definitely appreciate fewer dependencies, mostly to reduce the chance of (or difficulty of resolving) conflicts with any other dependencies I may have (especially painful when incompatible v0.X.Y transitive dependencies are used). It

[go-nuts] Re: Go doc examples from the command line?

2022-01-21 Thread Sean Liao
nope https://github.com/golang/go/issues/26715 On Friday, January 21, 2022 at 11:38:19 AM UTC+1 steve@gmail.com wrote: > I've been using, for example. "go doc -all encoding/csv" to display > docs from the command line. > > Is there any of displaying the code examples visible from the go.dev

  1   2   >