Skip to main content
0 votes
0 answers
18 views

Some question about go encoding/json read more bytes

In go encoding/json src code, If there is not enough data in decoder.buf when decoding, it will read some data from the reader it holds, this is source coude func (dec *Decoder) refill() error { //...
jaeger's user avatar
  • 1
2 votes
0 answers
10 views

Is there a way to run gorm's AutoMigrate using oldStruct but only migrating the tempStruct?

I have a table user that is really big, which causes AutoMigrate to hangs when I try to use it to create new column or modify the column, which takes down my site for a bit. One solution I am trying ...
mrwuscience's user avatar
0 votes
0 answers
27 views

int64/* type parameter */ does not satisfy constraints.Integer [duplicate]

I am working with a function passing custom types: type OrderedType[T constraints.Ordered] struct { Value T } func (o *OrderedType[T]) GetValue() T { return o.Value } func (o *OrderedType[T])...
Amanuel Getachew's user avatar
-2 votes
0 answers
34 views

Are the required packages also shared among sub go modules within the same go.work?

Say the repo dir structure is: repo/ go.work a/ go.mod b/ go.mod go.work is: go 1.23.2 use ( a b ) If a/go.mod required a lib github.com/imroc/req/v3, then seems ...
Eric's user avatar
  • 24.4k
-1 votes
0 answers
19 views

ion-sfu flutter client fails to connect in wss [closed]

Problem Description When I run the sfu-ion server with TLS disabled (tls: false), everything works as expected using the URL: http://[domain_name]:5551 After enabling TLS (tls: true), the server runs ...
Mir Injamamul's user avatar
-2 votes
1 answer
52 views

Why fmt.Fprint doesn't work with bufio.Writer? [closed]

enter image description hereenter image description here enter image description hereenter image description here func main() { a := "bebra" f, _ := os.Create("bebra.txt") ...
z0tedd's user avatar
  • 7
-1 votes
0 answers
42 views

Why does Go's standard crypto library make it impossible to parse X.509 certificates with "illegal" subjects? [closed]

I need to load a set of X.509 certificates into my Go application. The certs are not under my control, but as I've now learned, the Go standard crypto library won't parse them if the Subject field is ...
Chris Jansson's user avatar
0 votes
1 answer
33 views

Streaming yaml parsing, but Decode twice

I use that to parse yaml with several docs in one file: package main import ( "errors" "fmt" "io" "os" "gopkg.in/yaml.v3" ) ...
guettli's user avatar
  • 29.1k
1 vote
0 answers
37 views

Exclusion of paths via Google RE2 flavour regex

I am trying to validate a string in Kubernetes CRD via pattern field, which should be a valid Unix path, which excludes several directories, such as /root, /boot, /dev etc. The idea is to validate the ...
Mykhailo Shyshov's user avatar
2 votes
0 answers
20 views

GO WebSocket to stream public Mastodon posts gives bad handshake

I am trying to stream public posts from Mastodon in real-time using WebSockets and retrieving public posts using the API. However, I am encountering a issue bad handshake error when using WebSocket. ...
Europa's user avatar
  • 1,160
0 votes
0 answers
32 views

Intercept WebSocket data at Proxy Server

I have a WebSocket Client which was connected to WebSocket Server directly. WS_Server <--> WS_Client I need a forward proxy to intercept the data between client and server. WS_Server <--> ...
ray an's user avatar
  • 1,270
1 vote
1 answer
38 views

Subsequent PDF Signature Invalidates Previous Signature

I'm encountering an issue with applying multiple digital signatures to a PDF file generated using an updated version of the Go package github.com/digitorus/pdfsign. When viewing the document in Adobe ...
vanbroup's user avatar
-4 votes
0 answers
36 views

Import function from other Directories in Golang [duplicate]

I have following directories. MyProject |-client | |-controllers | |-user_management_test.go |-tests |-utils.go there are few utils functions defined in my MyProject/tests/...
Sahib Yar's user avatar
  • 1,028
-3 votes
0 answers
47 views

Read file metadata [closed]

How to read the general metadata attached to a file specially when that file comes as a byte stream (io.ReadCloser)? And we should not read the full stream and must jump to the section containing this ...
Arnold Zahrneinder's user avatar
2 votes
1 answer
70 views

Why does GORM's AutoMigrate always alter timestamp(0) columns on each run, and how can I prevent this?

I'm using GORM with PostgreSQL, and I'm encountering an issue where GORM's AutoMigrate function always tries to alter the timestamp(0) column type every time it runs, even if the column's type is ...
Md. Moshiur Rahman's user avatar

15 30 50 per page
1
2 3 4 5
4934