Re: [go-nuts] what's the most popular kafka library to use

2023-03-13 Thread Vasiliy Tolstov
I'm try all kafka libraries and my list: 1. github.com/twmb/franz-go/kgo - the best, no problems is around 1.5-2 years 2. github.com/segmentio/kafka-go (cool but have some errors 1.5 years ago, so i broke my production cluster with it) -- Vasiliy Tolstov, e-mail: v.tols...@selfip.r

Re: [go-nuts] How to encode/decode string to binary in golang

2023-03-13 Thread robert engels
Am arbitrary byte can be encoded in 2 HEX characters - only a 2x increase in size not 8x. > On Mar 13, 2023, at 2:35 PM, Volker Dobler wrote: > > On Monday, 13 March 2023 at 17:41:42 UTC+1 Van Fury wrote: > Relating to my previous question, I have been reading but it is still not > clear to me

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

2023-03-13 Thread Andrew Harris
I'm not sure I completely grasp the use case here in detail, but FWIW, I explored collation of log lines per-test with https://pkg.go.dev/golang.org/x/exp/slog a while ago and ended up with a struct that implements both testing.TB and slog.Handler. The idea was: (1) testing.TB methods that log,

Re: [go-nuts] How to encode/decode string to binary in golang

2023-03-13 Thread Volker Dobler
On Monday, 13 March 2023 at 17:41:42 UTC+1 Van Fury wrote: Relating to my previous question, I have been reading but it is still not clear to me what raw binary is, how is it different from text formatted binary (fmt.Sprintf("%b", s1s2Byte))? "text formated binary" takes a stream of bytes and f

Re: [go-nuts] what's the most popular kafka library to use

2023-03-13 Thread Eli Lindsey
> Is there an obvious choice here? what are people using now days (March 2023) I don’t think there’s an obvious choice, there’s three or four main libs, any of which may be good for different uses. Some color on confluent-kafka-go - it's a wrapper around librdkafka. librdkafka is the main Kafka

Re: [go-nuts] How to encode/decode string to binary in golang

2023-03-13 Thread Bruno Albuquerque
I wonder if what is needed here is just null-terminated strings. -Bruno On Mon, Mar 13, 2023 at 1:28 PM Kurtis Rader wrote: > On Mon, Mar 13, 2023 at 9:41 AM Van Fury wrote: > >> Relating to my previous question, I have been reading but it is still not >> clear to me what raw binary is, how i

Re: [go-nuts] How to encode/decode string to binary in golang

2023-03-13 Thread Kurtis Rader
On Mon, Mar 13, 2023 at 9:41 AM Van Fury wrote: > Relating to my previous question, I have been reading but it is still not > clear to me what raw binary is, how is it different from > text formatted binary (fmt.Sprintf("%b", s1s2Byte))? > In my problem above I need to encode s1+s2 to raw binary

[go-nuts] [ANN] GoNB: A Go Notebook Kernel for Jupyter

2023-03-13 Thread Jan
hi, I recently released GoNB (github.com/janpfeifer/gonb) and after some heavy use, since it's been behaving reliably, I wanted to share here. Highlights: - Easy tutorial ! - Ins

[go-nuts] what's the most popular kafka library to use

2023-03-13 Thread ami malimovka
Currently I'm interested only in consuming/producing. I'm aware of *confluent-kafka-go *and of *sarama, *and it looks like sarama has more github swag, but other than that I have no idea which one is better/more popular. Is there an obvious choice here? what are people using now days (March 202

Re: [go-nuts] How to encode/decode string to binary in golang

2023-03-13 Thread Van Fury
Relating to my previous question, I have been reading but it is still not clear to me what raw binary is, how is it different from text formatted binary (fmt.Sprintf("%b", s1s2Byte))? In my problem above I need to encode s1+s2 to raw binary before sending the result to the server which then decodes

Re: [go-nuts] How to encode/decode string to binary in golang

2023-03-13 Thread Van Fury
Do you mean encoding should be rawdata := fmt.Print("%016d%s%s", len(s1), s1,s2) or rawdata := fmt.Printf("%016d%s%s", len(s1), s1,s2) On Monday, March 13, 2023 at 4:36:50 PM UTC+2 Alex Howarth wrote: > You might be looking for strconv.ParseUint() > https://pkg.go.dev/strconv#ParseUint > > h

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

2023-03-13 Thread 'Patrick Ohly' via golang-nuts
> Associate with the context a Logger that goes to T.Log? That is indeed the approach taken in https://pkg.go.dev/k8s.io/klog/v2/ktesting for contextual logging with go-logr. https://pkg.go.dev/golang.org/x/exp/slog doesn't have anything for it at the moment, at least not out-of-the-box. The

Re: [go-nuts] How to encode/decode string to binary in golang

2023-03-13 Thread Alex Howarth
You might be looking for strconv.ParseUint() https://pkg.go.dev/strconv#ParseUint https://go.dev/play/p/qAO9LfLD41D On Mon, 13 Mar 2023 at 07:24, Van Fury wrote: > > Sorry I did not frame my question properly but what I would like to do is > to > encode concatenated s1 and s2 into raw binary an

Re: [go-nuts] How to encode/decode string to binary in golang

2023-03-13 Thread Volker Dobler
On Monday, 13 March 2023 at 12:24:15 UTC+1 Van Fury wrote: Sorry I did not frame my question properly but what I would like to do is to encode concatenated s1 and s2 into raw binary and then decode the raw binary back to s1 and s2. The only problem is knowing where s1 ends / where s2 starts. So

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

2023-03-13 Thread mspre...@gmail.com
With contextual logging, do we now have a better pattern easily available? Associate with the context a Logger that goes to T.Log? On Monday, March 13, 2023 at 5:00:51 AM UTC-4 Patrick Ohly wrote: > The underlying problem is that a "go test" only has one output stream: the > text written via `T

Re: [go-nuts] How to encode/decode string to binary in golang

2023-03-13 Thread Van Fury
Sorry I did not frame my question properly but what I would like to do is to encode concatenated s1 and s2 into raw binary and then decode the raw binary back to s1 and s2. On Friday, March 10, 2023 at 11:36:09 PM UTC+2 Alex Howarth wrote: > If s1 and s2 are a fixed length then you can just sl

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

2023-03-13 Thread 'Patrick Ohly' via golang-nuts
The underlying problem is that a "go test" only has one output stream: the text written via `T.Log`. Additional output on stdout or stderr isn't associated with the test that produced it, which is bad when running tests in parallel or when running without "go test -v". Sean Liao schrieb am Frei