diff --git a/examples/simple/main.go b/examples/simple/main.go index dd5bc1c..e457685 100644 --- a/examples/simple/main.go +++ b/examples/simple/main.go @@ -9,7 +9,7 @@ import ( "syscall" "cloud.google.com/go/spanner" - "github.com/flowerinthenight/spindle" + "github.com/flowerinthenight/spindle/v2" ) func main() { @@ -36,7 +36,7 @@ func main() { lock.Run(quit, done) // start main loop go func() { - sigch := make(chan os.Signal) + sigch := make(chan os.Signal, 1) signal.Notify(sigch, syscall.SIGINT, syscall.SIGTERM) <-sigch cancel() diff --git a/examples/testlock/main.go b/examples/testlock/main.go index 9037431..3844904 100644 --- a/examples/testlock/main.go +++ b/examples/testlock/main.go @@ -3,13 +3,13 @@ package main import ( "context" "fmt" - "io/ioutil" + "io" "log" "sync" "time" "cloud.google.com/go/spanner" - spindlelock "github.com/flowerinthenight/spindle/lock" + spindlelock "github.com/flowerinthenight/spindle/v2/lock" ) func main() { @@ -36,7 +36,7 @@ func main() { Table: "curmxdlock", Name: lockname, Duration: 2000, - Logger: log.New(ioutil.Discard, "", 0), // don't set if you want to see spindle logs + Logger: log.New(io.Discard, "", 0), // don't set if you want to see spindle logs }) ctx := context.Background() diff --git a/go.mod b/go.mod index 99eb5c0..a79dd15 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,11 @@ -module github.com/flowerinthenight/spindle +module github.com/flowerinthenight/spindle/v2 go 1.21 require ( cloud.google.com/go/spanner v1.64.0 github.com/cespare/xxhash/v2 v2.3.0 + github.com/flowerinthenight/spindle v1.2.7 github.com/google/uuid v1.6.0 github.com/googleapis/gax-go/v2 v2.12.5 google.golang.org/api v0.187.0 @@ -16,8 +17,6 @@ require ( cloud.google.com/go/auth v0.6.1 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect cloud.google.com/go/compute/metadata v0.4.0 // indirect - cloud.google.com/go/iam v1.1.10 // indirect - cloud.google.com/go/longrunning v0.5.9 // indirect github.com/GoogleCloudPlatform/grpc-gcp-go/grpcgcp v1.5.0 // indirect github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b // indirect @@ -35,7 +34,6 @@ require ( go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect go.opentelemetry.io/otel v1.28.0 // indirect go.opentelemetry.io/otel/metric v1.28.0 // indirect - go.opentelemetry.io/otel/sdk v1.28.0 // indirect go.opentelemetry.io/otel/trace v1.28.0 // indirect golang.org/x/crypto v0.24.0 // indirect golang.org/x/net v0.26.0 // indirect @@ -45,7 +43,6 @@ require ( golang.org/x/text v0.16.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect - google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/grpc v1.65.0 // indirect diff --git a/go.sum b/go.sum index 5142570..f18f302 100644 --- a/go.sum +++ b/go.sum @@ -683,6 +683,8 @@ github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/flowerinthenight/spindle v1.2.7 h1:cSq4StAaiJBKQNt3ASJpK4H03jofU/FwsDhH3Wz3Igs= +github.com/flowerinthenight/spindle v1.2.7/go.mod h1:kIJMeGJ/Sa9JHqohtHjf7CNXp8gB4aoOtUTpcW2a6/A= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=