_______________________________
# go run sigsegv.go 
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa68a44]

goroutine 1 [running]:
cloud.google.com/go/firestore.(*Client).Close(...)
/root/go/pkg/mod/cloud.google.com/go/firestore@v1.18.0/client.go:138
main.main()
/var/www/html/crm/sigsegv.go:25 +0x104
exit status 2

___________________________________
#cat sigsegv.go
package main

import (

  "fmt"
  "context"
  "google.golang.org/api/option"
  "cloud.google.com/go/firestore"

)

func main() {

ctx := context.Background()
opt := option.WithCredentialsFile("MISSING_FILENAME") 
client, err2 := firestore.NewClient(ctx, "MYPROJECT", opt)

if err2 != nil {
  fmt.Errorf("error initializing app: %v", err2)

} else {
fmt.Print("auth OK.\n")
}

client.Close()
}
________________________________________
# cat go.mod 
module sigsegv

go 1.24.0

require (
cloud.google.com/go/firestore v1.18.0
google.golang.org/api v0.223.0
)

require (
cloud.google.com/go v0.117.0 // indirect
cloud.google.com/go/auth v0.15.0 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.7 // indirect
cloud.google.com/go/compute/metadata v0.6.0 // indirect
cloud.google.com/go/longrunning v0.6.2 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/google/s2a-go v0.1.9 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc 
v0.59.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // 
indirect
go.opentelemetry.io/otel v1.34.0 // indirect
go.opentelemetry.io/otel/metric v1.34.0 // indirect
go.opentelemetry.io/otel/trace v1.34.0 // indirect
golang.org/x/crypto v0.33.0 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/oauth2 v0.26.0 // indirect
golang.org/x/sync v0.11.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/text v0.22.0 // indirect
golang.org/x/time v0.10.0 // indirect
google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect
google.golang.org/genproto/googleapis/api 
v0.0.0-20241209162323-e6fa225c2576 // indirect
google.golang.org/genproto/googleapis/rpc 
v0.0.0-20250219182151-9fdb1cabc7b2 // indirect
google.golang.org/grpc v1.70.0 // indirect
google.golang.org/protobuf v1.36.5 // indirect
)

-- 
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 visit 
https://groups.google.com/d/msgid/golang-nuts/d5b3f81b-d06d-42db-91a0-6cb8fa735912n%40googlegroups.com.

Reply via email to