Skip to content

Commit

Permalink
fix v2
Browse files Browse the repository at this point in the history
  • Loading branch information
ripexz committed Apr 26, 2023
1 parent 71bb0b0 commit 8526dee
Show file tree
Hide file tree
Showing 23 changed files with 54 additions and 48 deletions.
2 changes: 1 addition & 1 deletion aesutil/aesutil.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package aesutil provides a set of functions for 2-way encryption and hashing.
package aesutil // import "github.com/teamwork/utils/aesutil"
package aesutil // import "github.com/teamwork/utils/v2/aesutil"

import (
"crypto/aes"
Expand Down
2 changes: 1 addition & 1 deletion dbg/dbg.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package dbg contains helper functions useful when debugging programs.
package dbg // import "github.com/teamwork/utils/dbg"
package dbg // import "github.com/teamwork/utils/v2/dbg"

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Package utils is a collection of often used extensions to Go's stdlib.
package utils // import "github.com/teamwork/utils"
package utils // import "github.com/teamwork/utils/v2/v2"
2 changes: 1 addition & 1 deletion errorutil/errorutil.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package errorutil provides functions to work with errors.
package errorutil // import "github.com/teamwork/utils/errorutil"
package errorutil // import "github.com/teamwork/utils/v2/errorutil"

import (
"fmt"
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/teamwork/utils
module github.com/teamwork/utils/v2

go 1.20

Expand All @@ -12,6 +12,7 @@ require (
require (
github.com/Strum355/go-difflib v1.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/teamwork/utils v1.0.0 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/sys v0.7.0 // indirect
)
5 changes: 5 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
github.com/Strum355/go-difflib v1.1.0 h1:+rR2X3UuvIbe1Jmhx8WA7gkgjMNRscFWbHchk2RB8I4=
github.com/Strum355/go-difflib v1.1.0/go.mod h1:r1cVg1JkGsTWkaR7At56v7hfuMgiUL8meTLwxFzOmvE=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/mattn/goveralls v0.0.11 h1:eJXea6R6IFlL1QMKNMzDvvHv/hwGrnvyig4N+0+XiMM=
github.com/mattn/goveralls v0.0.11/go.mod h1:gU8SyhNswsJKchEV93xRQxX6X3Ei4PJdQk/6ZHvrvRk=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/teamwork/test v0.0.0-20190410143529-8897d82f8d46/go.mod h1:TIbx7tx6WHBjQeLRM4eWQZBL7kmBZ7/KI4x4v7Y5YmA=
github.com/teamwork/test v0.0.0-20200108114543-02621bae84ad h1:25sEr0awm0ZPancg5W5H5VvN7PWsJloUBpii10a9isw=
github.com/teamwork/test v0.0.0-20200108114543-02621bae84ad/go.mod h1:TIbx7tx6WHBjQeLRM4eWQZBL7kmBZ7/KI4x4v7Y5YmA=
github.com/teamwork/utils v1.0.0 h1:30WqhSbZ9nFhaJSx9HH+yFLiQvL64nqAOyyl5IxoYlY=
github.com/teamwork/utils v1.0.0/go.mod h1:3Fn0qxFeRNpvsg/9T1+btOOOKkd1qG2nPYKKcOmNpcs=
golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk=
golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
Expand Down
2 changes: 1 addition & 1 deletion goutil/goutil.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package goutil provides functions to work with Go source files.
package goutil // import "github.com/teamwork/utils/goutil"
package goutil // import "github.com/teamwork/utils/v2/goutil"

import (
"errors"
Expand Down
50 changes: 25 additions & 25 deletions goutil/goutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,48 +47,48 @@ func TestExpand(t *testing.T) {
"",
},
{
[]string{"github.com/teamwork/utils"},
[]string{"github.com/teamwork/utils"},
[]string{"github.com/teamwork/utils/v2"},
[]string{"github.com/teamwork/utils/v2"},
"",
},
{
[]string{"."},
[]string{"github.com/teamwork/utils/goutil"},
[]string{"github.com/teamwork/utils/v2/goutil"},
"",
},
{
[]string{""},
[]string{"github.com/teamwork/utils/goutil"},
[]string{"github.com/teamwork/utils/v2/goutil"},
"",
},
{
[]string{".."},
[]string{"github.com/teamwork/utils"},
[]string{"github.com/teamwork/utils/v2"},
"",
},
{
[]string{"../..."},
[]string{
"github.com/teamwork/utils",
"github.com/teamwork/utils/aesutil",
"github.com/teamwork/utils/dbg",
"github.com/teamwork/utils/errorutil",
"github.com/teamwork/utils/goutil",
"github.com/teamwork/utils/httputilx",
"github.com/teamwork/utils/httputilx/header",
"github.com/teamwork/utils/imageutil",
"github.com/teamwork/utils/ioutilx",
"github.com/teamwork/utils/jsonutil",
"github.com/teamwork/utils/maputil",
"github.com/teamwork/utils/mathutil",
"github.com/teamwork/utils/netutil",
"github.com/teamwork/utils/ptrutil",
"github.com/teamwork/utils/raceutil",
"github.com/teamwork/utils/sliceutil",
"github.com/teamwork/utils/sqlutil",
"github.com/teamwork/utils/stringutil",
"github.com/teamwork/utils/syncutil",
"github.com/teamwork/utils/timeutil",
"github.com/teamwork/utils/v2",
"github.com/teamwork/utils/v2/aesutil",
"github.com/teamwork/utils/v2/dbg",
"github.com/teamwork/utils/v2/errorutil",
"github.com/teamwork/utils/v2/goutil",
"github.com/teamwork/utils/v2/httputilx",
"github.com/teamwork/utils/v2/httputilx/header",
"github.com/teamwork/utils/v2/imageutil",
"github.com/teamwork/utils/v2/ioutilx",
"github.com/teamwork/utils/v2/jsonutil",
"github.com/teamwork/utils/v2/maputil",
"github.com/teamwork/utils/v2/mathutil",
"github.com/teamwork/utils/v2/netutil",
"github.com/teamwork/utils/v2/ptrutil",
"github.com/teamwork/utils/v2/raceutil",
"github.com/teamwork/utils/v2/sliceutil",
"github.com/teamwork/utils/v2/sqlutil",
"github.com/teamwork/utils/v2/stringutil",
"github.com/teamwork/utils/v2/syncutil",
"github.com/teamwork/utils/v2/timeutil",
},
"",
},
Expand Down
2 changes: 1 addition & 1 deletion httputilx/header/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package header_test
import (
"net/http"

"github.com/teamwork/utils/httputilx/header"
"github.com/teamwork/utils/v2/httputilx/header"
)

func ExampleSetCSP() {
Expand Down
2 changes: 1 addition & 1 deletion httputilx/header/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// https://developers.google.com/open-source/licenses/bsd.

// Package header provides functions for parsing and setting HTTP headers.
package header // import "github.com/teamwork/utils/httputilx/header"
package header // import "github.com/teamwork/utils/v2/httputilx/header"

import (
"net/http"
Expand Down
4 changes: 2 additions & 2 deletions httputilx/httputilx.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package httputilx provides HTTP utility functions.
package httputilx // import "github.com/teamwork/utils/httputilx"
package httputilx // import "github.com/teamwork/utils/v2/httputilx"

import (
"bytes"
Expand All @@ -13,7 +13,7 @@ import (
"time"

"github.com/pkg/errors"
"github.com/teamwork/utils/ioutilx"
"github.com/teamwork/utils/v2/ioutilx"
)

// DumpBody reads the body of a HTTP request without consuming it, so it can be
Expand Down
2 changes: 1 addition & 1 deletion imageutil/doc.go
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Package imageutil adds functions for working with images.
package imageutil // import "github.com/teamwork/utils/imageutil"
package imageutil // import "github.com/teamwork/utils/v2/imageutil"
2 changes: 1 addition & 1 deletion ioutilx/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"time"

"github.com/pkg/errors"
"github.com/teamwork/utils/sliceutil"
"github.com/teamwork/utils/v2/sliceutil"
)

// ErrSameFile is used when the source and destination file are the same file.
Expand Down
2 changes: 1 addition & 1 deletion ioutilx/ioutilx.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package ioutilx implements some I/O utility functions.
package ioutilx // import "github.com/teamwork/utils/ioutilx"
package ioutilx // import "github.com/teamwork/utils/v2/ioutilx"

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion jsonutil/jsonutil.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package jsonutil provides functions for working with JSON.
package jsonutil // import "github.com/teamwork/utils/jsonutil"
package jsonutil // import "github.com/teamwork/utils/v2/jsonutil"

import "encoding/json"

Expand Down
2 changes: 1 addition & 1 deletion maputil/maputil.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package maputil provides a set if functions for working with maps.
package maputil // import "github.com/teamwork/utils/maputil"
package maputil // import "github.com/teamwork/utils/v2/maputil"

// Swap the keys and values of a map.
func Swap[T comparable, V comparable](m map[T]V) map[V]T {
Expand Down
2 changes: 1 addition & 1 deletion mathutil/mathutil.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package mathutil provides functions for working with numbers.
package mathutil // import "github.com/teamwork/utils/mathutil"
package mathutil // import "github.com/teamwork/utils/v2/mathutil"

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion netutil/netutil.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package netutil provides functions expanding on net std package.
package netutil // import "github.com/teamwork/utils/netutil"
package netutil // import "github.com/teamwork/utils/v2/netutil"

import "net"

Expand Down
2 changes: 1 addition & 1 deletion sliceutil/sliceutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// "sets" (e.g. it will retain order, []int64 can contain duplicates). Consider
// using something like golang-set if you want to use sets and care a lot about
// performance: https://github.com/deckarep/golang-set
package sliceutil // import "github.com/teamwork/utils/sliceutil"
package sliceutil // import "github.com/teamwork/utils/v2/sliceutil"

import (
"fmt"
Expand Down
4 changes: 2 additions & 2 deletions sqlutil/sqlutil.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package sqlutil provides some helpers for SQL databases.
package sqlutil // import "github.com/teamwork/utils/sqlutil"
package sqlutil // import "github.com/teamwork/utils/v2/sqlutil"

import (
"database/sql/driver"
Expand All @@ -8,7 +8,7 @@ import (
"strconv"
"strings"

"github.com/teamwork/utils/sliceutil"
"github.com/teamwork/utils/v2/sliceutil"
)

// IntList expands comma-separated values from a column to []int64, and stores
Expand Down
2 changes: 1 addition & 1 deletion stringutil/stringutil.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package stringutil adds functions for working with strings.
package stringutil // import "github.com/teamwork/utils/stringutil"
package stringutil // import "github.com/teamwork/utils/v2/stringutil"

import (
"regexp"
Expand Down
2 changes: 1 addition & 1 deletion syncutil/syncutil.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package syncutil adds functions for synchronization.
package syncutil // import "github.com/teamwork/utils/syncutil"
package syncutil // import "github.com/teamwork/utils/v2/syncutil"

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion timeutil/timeutil.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package timeutil provides functions for working with time.
package timeutil // import "github.com/teamwork/utils/timeutil"
package timeutil // import "github.com/teamwork/utils/v2/timeutil"

import "time"

Expand Down

0 comments on commit 8526dee

Please sign in to comment.