Skip to content

Instantly share code, notes, and snippets.

View nikole-dunixi's full-sized avatar
🦊

Nikole Dunixi nikole-dunixi

🦊
View GitHub Profile
@nikole-dunixi
nikole-dunixi / debug.go
Created March 15, 2024 16:51
Find unequal struct fields in golang
// Custom comparison function
func compareStructs(a, b interface{}) {
valA := reflect.ValueOf(a)
valB := reflect.ValueOf(b)
for i := 0; i < valA.NumField(); i++ {
fieldA := valA.Field(i)
fieldB := valB.Field(i)
if !reflect.DeepEqual(fieldA.Interface(), fieldB.Interface()) {
@nikole-dunixi
nikole-dunixi / http1.go
Created June 4, 2024 17:45
Common Golang Http Client Configurations
// https://medium.com/@nate510/don-t-use-go-s-default-http-client-4804cb19f779
client := &http.Client{
Timeout: time.Second * 10,
Transport: &http.Transport{
Dial: (&net.Dialer{
Timeout: 5 * time.Second,
}).Dial,
TLSHandshakeTimeout: 5 * time.Second,
},
}

Keybase proof

I hereby claim:

  • I am nikole-dunixi on github.
  • I am nikoledunixi (https://keybase.io/nikoledunixi) on keybase.
  • I have a public key ASBKW2rD7X6Pp_o_IJFLntMb6tXTlNFT2ZUJgZtlvaP6jAo

To claim this, I am signing this object: