Re: [go-nuts] Is golang.org/x/text/message's Printer thread safe?

2024-04-22 Thread Xiangrong Fang
Thanks for the tip! Jan Mercl <0xj...@gmail.com> 于2024年4月22日周一 17:38写道: > On Mon, Apr 22, 2024 at 11:23 AM Xiangrong Fang wrote: > > > Is golang.org/x/text/message's *message.Printer safe to use in > goroutines? > > I don't know, but usually things are

[go-nuts] Is golang.org/x/text/message's Printer thread safe?

2024-04-22 Thread Xiangrong Fang
Is golang.org/x/text/message's *message.Printer safe to use in goroutines? Thanks. -- 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...@google

Re: [go-nuts] Re: go mod conflict whith v2 pre-release

2024-04-17 Thread Xiangrong Fang
is feels like it could > get confusing (for the wetware - i.e. humans - if not the tooling). > > > This is a genuine question, not intended to criticise the approach but to > understand it as - if "official" - it's something I did not come across > when researching th

Re: [go-nuts] Re: go mod conflict whith v2 pre-release

2024-04-17 Thread Xiangrong Fang
.22.1; > switching to go1.22.2 > go: upgraded go 1.22.0 => 1.22.1 > go: added toolchain go1.22.2 > go: added go.xrfang.cn/hap/v2 v2.0.0-alpha.2 > > On Wednesday, April 17, 2024 at 10:31:07 AM UTC-4 Xiangrong Fang wrote: > >> Hi Jason, >> >> Ac

Re: [go-nuts] Re: go mod conflict whith v2 pre-release

2024-04-17 Thread Xiangrong Fang
n/hap/v2". > > Compare the output from Github for a module with a major version directory: > > > curl https://github.com/wailsapp/wails/v2?go-get=1 > Not Found > On Wednesday, April 17, 2024 at 5:46:15 AM UTC-4 Xiangrong Fang wrote: > >> Hello, >> &l

[go-nuts] go mod conflict whith v2 pre-release

2024-04-17 Thread Xiangrong Fang
Hello, I am developing version 2 of my hap package, which is a HTTP API framework. Version 2 is not ready yet, and the latest release ls v2.0.0-alpha.2, like so: * 9319436 - bug fix, refined action error output (H

Re: [go-nuts] problem with generic type switch

2024-04-09 Thread Xiangrong Fang
ssues/45380>, which would be able to solve > this without reflect. > > On Mon, Apr 8, 2024 at 11:04 AM Xiangrong Fang wrote: > >> I wrote a TLV handling package: go.xrfang.cn/tlv >> <https://pkg.go.dev/go.xrfang.cn/tlv>, and encountered problem with type >

[go-nuts] problem with generic type switch

2024-04-08 Thread Xiangrong Fang
I wrote a TLV handling package: go.xrfang.cn/tlv , and encountered problem with type checking. Problematic code below: 1. The "Set" function in side tlv package: package tlv type ( ValueType interface { string | []byte | ~float32 | ~float64 |

Re: [go-nuts] a potential problem with go1.11 HTTP library

2018-09-25 Thread Xiangrong Fang
: > https://github.com/golang/go/issues/27525 > > On 25/09/2018 08:36, Xiangrong Fang wrote: > > I have a HTTP API and its client written in Go. The client side code is: > > func upload(link, dir, name string, r io.Reader) { > var buf bytes.Buffer > mw := multipart.NewWri

[go-nuts] a potential problem with go1.11 HTTP library

2018-09-25 Thread Xiangrong Fang
I have a HTTP API and its client written in Go. The client side code is: func upload(link, dir, name string, r io.Reader) { var buf bytes.Buffer mw := multipart.NewWriter(&buf) mw.WriteField("dir", dir) mw.WriteField("name", name) ff, _ := mw.CreateFormFile("file", name) io.Copy(ff, r) mw.Close()