Skip to content

Commit

Permalink
chore: Upgrade go-utils module version from v4 to v5 across the codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Laisky committed Dec 12, 2024
1 parent 35e1e11 commit c6008c3
Show file tree
Hide file tree
Showing 67 changed files with 113 additions and 116 deletions.
2 changes: 1 addition & 1 deletion algorithm/heap.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/Laisky/errors/v2"

"github.com/Laisky/go-utils/v4/common"
"github.com/Laisky/go-utils/v5/common"
)

// GetLargestNItems get N highest priority items
Expand Down
2 changes: 1 addition & 1 deletion algorithm/priorityq.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package algorithm
import (
"container/heap"

"github.com/Laisky/go-utils/v4/common"
"github.com/Laisky/go-utils/v5/common"
)

// PriorityQ priority queue
Expand Down
2 changes: 1 addition & 1 deletion async.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/Laisky/errors/v2"
"github.com/Laisky/zap"

"github.com/Laisky/go-utils/v4/log"
"github.com/Laisky/go-utils/v5/log"
)

// AsyncTaskStatus status of async task
Expand Down
4 changes: 2 additions & 2 deletions cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"github.com/Laisky/golang-fifo/sieve"

"github.com/Laisky/go-utils/v4/algorithm"
"github.com/Laisky/go-utils/v4/log"
"github.com/Laisky/go-utils/v5/algorithm"
"github.com/Laisky/go-utils/v5/log"
)

// NewLruCache new lru cache
Expand Down
6 changes: 3 additions & 3 deletions cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func TestNewLruCache(t *testing.T) {

// goos: linux
// goarch: amd64
// pkg: github.com/Laisky/go-utils/v4
// pkg: github.com/Laisky/go-utils/v5
// cpu: Intel(R) Xeon(R) Gold 5320 CPU @ 2.20GHz
// Benchmark_TtlCache
// Benchmark_TtlCache/set
Expand Down Expand Up @@ -217,7 +217,7 @@ func Benchmark_TtlCache(b *testing.B) {

// goos: linux
// goarch: amd64
// pkg: github.com/Laisky/go-utils/v4
// pkg: github.com/Laisky/go-utils/v5
// cpu: Intel(R) Xeon(R) Gold 5320 CPU @ 2.20GHz
// Benchmark_ExpCache
// Benchmark_ExpCache/set
Expand Down Expand Up @@ -258,7 +258,7 @@ func Benchmark_ExpCache(b *testing.B) {
})
}

// pkg: github.com/Laisky/go-utils/v4
// pkg: github.com/Laisky/go-utils/v5
// cpu: Intel(R) Xeon(R) Gold 5320 CPU @ 2.20GHz
// Benchmark_Sieve
// Benchmark_Sieve/set
Expand Down
8 changes: 4 additions & 4 deletions cmd/aes.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"github.com/Laisky/zap"
"github.com/spf13/cobra"

gutils "github.com/Laisky/go-utils/v4"
gcrypto "github.com/Laisky/go-utils/v4/crypto"
"github.com/Laisky/go-utils/v4/log"
gutils "github.com/Laisky/go-utils/v5"
gcrypto "github.com/Laisky/go-utils/v5/crypto"
"github.com/Laisky/go-utils/v5/log"
)

// EncryptCMD encrypt files
Expand All @@ -28,7 +28,7 @@ var EncryptCMD = &cobra.Command{
Usage
import (
gcmd "github.com/Laisky/go-utils/v4/cmd"
gcmd "github.com/Laisky/go-utils/v5/cmd"
)
func init() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/gutils/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
package main

import (
"github.com/Laisky/go-utils/v4/cmd"
"github.com/Laisky/go-utils/v5/cmd"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions cmd/md5dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/Laisky/zap"
"github.com/spf13/cobra"

gutils "github.com/Laisky/go-utils/v4"
glog "github.com/Laisky/go-utils/v4/log"
gutils "github.com/Laisky/go-utils/v5"
glog "github.com/Laisky/go-utils/v5/log"
)

var md5DirArg struct {
Expand All @@ -40,7 +40,7 @@ var md5DirCMD = &cobra.Command{
Long: gutils.Dedent(`
Move files to hierarchy directories splitted by prefix of md5
go install github.com/Laisky/go-utils/v4/cmd/gutils@latest
go install github.com/Laisky/go-utils/v5/cmd/gutils@latest
gutils md5dir -i examples/md5dir/
`),
Expand Down
6 changes: 3 additions & 3 deletions cmd/removeduplicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"github.com/spf13/cobra"
"golang.org/x/sync/errgroup"

gutils "github.com/Laisky/go-utils/v4"
glog "github.com/Laisky/go-utils/v4/log"
gutils "github.com/Laisky/go-utils/v5"
glog "github.com/Laisky/go-utils/v5/log"
)

var removeDupArg struct {
Expand Down Expand Up @@ -51,7 +51,7 @@ var removeDupCMD = &cobra.Command{
Long: gutils.Dedent(`
Find and remove duplicate files or images
go install github.com/Laisky/go-utils/v4/cmd/gutils@latest
go install github.com/Laisky/go-utils/v5/cmd/gutils@latest
gutils remove-dup -d examples/images --dry
`),
Expand Down
2 changes: 1 addition & 1 deletion cmd/removeduplicate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/stretchr/testify/require"

gutils "github.com/Laisky/go-utils/v4"
gutils "github.com/Laisky/go-utils/v5"
)

func Test_switch(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions cmd/rename.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/Laisky/zap"
"github.com/spf13/cobra"

gutils "github.com/Laisky/go-utils/v4"
glog "github.com/Laisky/go-utils/v4/log"
gutils "github.com/Laisky/go-utils/v5"
glog "github.com/Laisky/go-utils/v5/log"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"github.com/Laisky/zap"
"github.com/spf13/cobra"

gutils "github.com/Laisky/go-utils/v4"
glog "github.com/Laisky/go-utils/v4/log"
gutils "github.com/Laisky/go-utils/v5"
glog "github.com/Laisky/go-utils/v5/log"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions cmd/rsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/Laisky/zap"
"github.com/spf13/cobra"

gcrypto "github.com/Laisky/go-utils/v4/crypto"
"github.com/Laisky/go-utils/v4/log"
gcrypto "github.com/Laisky/go-utils/v5/crypto"
"github.com/Laisky/go-utils/v5/log"
)

// RSA some rsa command tools
Expand Down
4 changes: 2 additions & 2 deletions cmd/rsa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

"github.com/stretchr/testify/require"

gutils "github.com/Laisky/go-utils/v4"
gcrypto "github.com/Laisky/go-utils/v4/crypto"
gutils "github.com/Laisky/go-utils/v5"
gcrypto "github.com/Laisky/go-utils/v5/crypto"
)

func Test_signFileByRSA(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions cmd/tls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (

"github.com/Laisky/zap"

gutils "github.com/Laisky/go-utils/v4"
gcrypto "github.com/Laisky/go-utils/v4/crypto"
glog "github.com/Laisky/go-utils/v4/log"
gutils "github.com/Laisky/go-utils/v5"
gcrypto "github.com/Laisky/go-utils/v5/crypto"
glog "github.com/Laisky/go-utils/v5/log"
)

func Test_showPemFileX509CertInfo(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions cmd/x509.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"github.com/Laisky/errors/v2"
"github.com/spf13/cobra"

gutils "github.com/Laisky/go-utils/v4"
gcrypto "github.com/Laisky/go-utils/v4/crypto"
gutils "github.com/Laisky/go-utils/v5"
gcrypto "github.com/Laisky/go-utils/v5/crypto"
)

func init() {
Expand Down Expand Up @@ -51,7 +51,7 @@ var tlsInfoCMD = &cobra.Command{
Install:
go install github.com/Laisky/go-utils/v4/cmd/gutils@latest
go install github.com/Laisky/go-utils/v5/cmd/gutils@latest
Examples:
Expand Down
4 changes: 2 additions & 2 deletions cmd/x509_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

"github.com/stretchr/testify/require"

gutils "github.com/Laisky/go-utils/v4"
gcrypto "github.com/Laisky/go-utils/v4/crypto"
gutils "github.com/Laisky/go-utils/v5"
gcrypto "github.com/Laisky/go-utils/v5/crypto"
)

func Test_tlsInfoCMD(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion compatability.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package utils

import "github.com/Laisky/go-utils/v4/common"
import "github.com/Laisky/go-utils/v5/common"

// Number is a number type
type Number common.Number
Expand Down
4 changes: 2 additions & 2 deletions compress/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/Laisky/zap"
"github.com/klauspost/pgzip"

gutils "github.com/Laisky/go-utils/v4"
"github.com/Laisky/go-utils/v4/log"
gutils "github.com/Laisky/go-utils/v5"
"github.com/Laisky/go-utils/v5/log"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions compress/compress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/Laisky/zap"
"github.com/stretchr/testify/require"

gutils "github.com/Laisky/go-utils/v4"
gcrypto "github.com/Laisky/go-utils/v4/crypto"
"github.com/Laisky/go-utils/v4/log"
gutils "github.com/Laisky/go-utils/v5"
gcrypto "github.com/Laisky/go-utils/v5/crypto"
"github.com/Laisky/go-utils/v5/log"
)

// func TestZipDir(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions counter/counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/Laisky/errors/v2"
"github.com/Laisky/zap"

gutils "github.com/Laisky/go-utils/v4"
"github.com/Laisky/go-utils/v4/log"
gutils "github.com/Laisky/go-utils/v5"
"github.com/Laisky/go-utils/v5/log"
)

// Int64CounterItf counter for int64
Expand Down
2 changes: 1 addition & 1 deletion counter/counter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/Laisky/zap"

"github.com/Laisky/go-utils/v4/log"
"github.com/Laisky/go-utils/v5/log"
)

func ExampleCounter() {
Expand Down
4 changes: 2 additions & 2 deletions crypto/aes.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/Laisky/zap"
"golang.org/x/sync/errgroup"

gutils "github.com/Laisky/go-utils/v4"
"github.com/Laisky/go-utils/v4/log"
gutils "github.com/Laisky/go-utils/v5"
"github.com/Laisky/go-utils/v5/log"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion crypto/aes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/stretchr/testify/require"

gutils "github.com/Laisky/go-utils/v4"
gutils "github.com/Laisky/go-utils/v5"
)

func TestAESEncryptFilesInDir(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion crypto/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

"github.com/Laisky/errors/v2"

gutils "github.com/Laisky/go-utils/v4"
gutils "github.com/Laisky/go-utils/v5"
)

// SecureCipherSuites get golang built-in cipher suites without known insecure suites
Expand Down
2 changes: 1 addition & 1 deletion crypto/converter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

"github.com/stretchr/testify/require"

gutils "github.com/Laisky/go-utils/v4"
gutils "github.com/Laisky/go-utils/v5"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion crypto/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/Laisky/errors/v2"
"golang.org/x/crypto/bcrypt"

gutils "github.com/Laisky/go-utils/v4"
gutils "github.com/Laisky/go-utils/v5"
)

// HashedPassword salt hashed password
Expand Down
2 changes: 1 addition & 1 deletion crypto/crypto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/stretchr/testify/require"

gutils "github.com/Laisky/go-utils/v4"
gutils "github.com/Laisky/go-utils/v5"
)

func TestRSAEncrypt(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion crypto/hkdf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/require"

gutils "github.com/Laisky/go-utils/v4"
gutils "github.com/Laisky/go-utils/v5"
)

func TestHKDFWithSHA256(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion crypto/kms/dto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/stretchr/testify/require"

gutils "github.com/Laisky/go-utils/v4"
gutils "github.com/Laisky/go-utils/v5"
)

func TestEncryptedItem_Unmarshal(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions crypto/kms/mem/kms.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"github.com/Laisky/errors/v2"
"github.com/Laisky/zap"

gcrypto "github.com/Laisky/go-utils/v4/crypto"
gkms "github.com/Laisky/go-utils/v4/crypto/kms"
glog "github.com/Laisky/go-utils/v4/log"
gcrypto "github.com/Laisky/go-utils/v5/crypto"
gkms "github.com/Laisky/go-utils/v5/crypto/kms"
glog "github.com/Laisky/go-utils/v5/log"
)

var (
Expand Down
8 changes: 4 additions & 4 deletions crypto/kms/mem/kms_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (

"github.com/stretchr/testify/require"

gutils "github.com/Laisky/go-utils/v4"
gcounter "github.com/Laisky/go-utils/v4/counter"
gcrypto "github.com/Laisky/go-utils/v4/crypto"
gkms "github.com/Laisky/go-utils/v4/crypto/kms"
gutils "github.com/Laisky/go-utils/v5"
gcounter "github.com/Laisky/go-utils/v5/counter"
gcrypto "github.com/Laisky/go-utils/v5/crypto"
gkms "github.com/Laisky/go-utils/v5/crypto/kms"
)

func TestKMS_Decrypt(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion crypto/otp.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/Laisky/errors/v2"
"github.com/xlzd/gotp"

gutils "github.com/Laisky/go-utils/v4"
gutils "github.com/Laisky/go-utils/v5"
)

// OTPType otp type
Expand Down
Loading

0 comments on commit c6008c3

Please sign in to comment.