From 50c6e51393cd69a2555429768dca5ad697d7778e Mon Sep 17 00:00:00 2001 From: dudaodong Date: Thu, 17 Mar 2022 10:57:35 +0800 Subject: [PATCH] upgrade go module v2 --- algorithm/lru_cache_test.go | 2 +- algorithm/search.go | 2 +- algorithm/search_test.go | 2 +- algorithm/sorter.go | 2 +- algorithm/sorter_test.go | 4 ++-- convertor/convertor_test.go | 2 +- cryptor/aes_test.go | 2 +- cryptor/basic_test.go | 2 +- cryptor/des_test.go | 2 +- cryptor/rsa_test.go | 2 +- datastructure/link/doublylink.go | 2 +- datastructure/link/doublylink_test.go | 2 +- datastructure/link/singlylink.go | 2 +- datastructure/link/singlylink_test.go | 2 +- datastructure/list/list_test.go | 2 +- datastructure/queue/arrayqueue_test.go | 2 +- datastructure/queue/circularqueue_test.go | 2 +- datastructure/queue/linkedqueue.go | 2 +- datastructure/queue/linkedqueue_test.go | 2 +- datastructure/set/set_test.go | 2 +- datastructure/stack/arraystack_test.go | 2 +- datastructure/stack/linkedstack.go | 2 +- datastructure/stack/linkedstack_test.go | 2 +- datastructure/tree/bstree.go | 4 ++-- datastructure/tree/bstree_test.go | 2 +- datastructure/tree/tree_internal.go | 4 ++-- datetime/datetime_test.go | 2 +- fileutil/file_test.go | 2 +- formatter/formatter_test.go | 2 +- function/function_test.go | 2 +- function/watcher_test.go | 2 +- go.mod | 2 +- mathutil/mathutil_test.go | 2 +- netutil/http_test.go | 2 +- netutil/net_test.go | 2 +- random/random_test.go | 2 +- retry/retry_test.go | 2 +- slice/slice_test.go | 2 +- strutil/string_test.go | 2 +- system/os_test.go | 2 +- validator/validator_test.go | 2 +- xerror/xerror_test.go | 3 ++- 42 files changed, 46 insertions(+), 45 deletions(-) diff --git a/algorithm/lru_cache_test.go b/algorithm/lru_cache_test.go index 8baaeec..fba5426 100644 --- a/algorithm/lru_cache_test.go +++ b/algorithm/lru_cache_test.go @@ -3,7 +3,7 @@ package algorithm import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestLRUCache(t *testing.T) { diff --git a/algorithm/search.go b/algorithm/search.go index 7653d5b..73c2ebc 100644 --- a/algorithm/search.go +++ b/algorithm/search.go @@ -4,7 +4,7 @@ // Package algorithm contain some basic algorithm functions. eg. sort, search, list, linklist, stack, queue, tree, graph. TODO package algorithm -import "github.com/duke-git/lancet/lancetconstraints" +import "github.com/duke-git/lancet/v2/lancetconstraints" // Search algorithms see https://github.com/TheAlgorithms/Go/tree/master/search diff --git a/algorithm/search_test.go b/algorithm/search_test.go index 7637ace..cd31800 100644 --- a/algorithm/search_test.go +++ b/algorithm/search_test.go @@ -3,7 +3,7 @@ package algorithm import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) var sortedNumbers = []int{1, 2, 3, 4, 5, 6, 7, 8} diff --git a/algorithm/sorter.go b/algorithm/sorter.go index 1a3741f..075ed0f 100644 --- a/algorithm/sorter.go +++ b/algorithm/sorter.go @@ -4,7 +4,7 @@ // Package algorithm contain some basic algorithm functions. eg. sort, search package algorithm -import "github.com/duke-git/lancet/lancetconstraints" +import "github.com/duke-git/lancet/v2/lancetconstraints" // BubbleSort use bubble to sort slice. func BubbleSort[T any](slice []T, comparator lancetconstraints.Comparator) []T { diff --git a/algorithm/sorter_test.go b/algorithm/sorter_test.go index 3aa6019..f6dd592 100644 --- a/algorithm/sorter_test.go +++ b/algorithm/sorter_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) // People test mock data @@ -16,7 +16,7 @@ type people struct { // PeopleAageComparator sort people slice by age field type peopleAgeComparator struct{} -// Compare implements github.com/duke-git/lancet/lancetconstraints/constraints.go/Comparator +// Compare implements github.com/duke-git/lancet/v2/lancetconstraints/constraints.go/Comparator func (pc *peopleAgeComparator) Compare(v1 any, v2 any) int { p1, _ := v1.(people) p2, _ := v2.(people) diff --git a/convertor/convertor_test.go b/convertor/convertor_test.go index 3501438..ca679c1 100644 --- a/convertor/convertor_test.go +++ b/convertor/convertor_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestToChar(t *testing.T) { diff --git a/cryptor/aes_test.go b/cryptor/aes_test.go index 928d63e..3cf2e3f 100644 --- a/cryptor/aes_test.go +++ b/cryptor/aes_test.go @@ -3,7 +3,7 @@ package cryptor import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestAesEcbEncrypt(t *testing.T) { diff --git a/cryptor/basic_test.go b/cryptor/basic_test.go index 90e5f92..d3e3228 100644 --- a/cryptor/basic_test.go +++ b/cryptor/basic_test.go @@ -3,7 +3,7 @@ package cryptor import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestBase64StdEncode(t *testing.T) { diff --git a/cryptor/des_test.go b/cryptor/des_test.go index 229fd41..1567435 100644 --- a/cryptor/des_test.go +++ b/cryptor/des_test.go @@ -3,7 +3,7 @@ package cryptor import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestDesEcbEncrypt(t *testing.T) { diff --git a/cryptor/rsa_test.go b/cryptor/rsa_test.go index 1a87c84..e7a6b52 100644 --- a/cryptor/rsa_test.go +++ b/cryptor/rsa_test.go @@ -3,7 +3,7 @@ package cryptor import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestRsaEncrypt(t *testing.T) { diff --git a/datastructure/link/doublylink.go b/datastructure/link/doublylink.go index 66c29be..447290a 100644 --- a/datastructure/link/doublylink.go +++ b/datastructure/link/doublylink.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/duke-git/lancet/datastructure" + "github.com/duke-git/lancet/v2/datastructure" ) // DoublyLink is a linked list. Whose node has a generic Value, Pre pointer points to a previous node of the link, Next pointer points to a next node of the link. diff --git a/datastructure/link/doublylink_test.go b/datastructure/link/doublylink_test.go index 4e1d19c..fb9b010 100644 --- a/datastructure/link/doublylink_test.go +++ b/datastructure/link/doublylink_test.go @@ -3,7 +3,7 @@ package datastructure import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestDoublyLink_InsertAtFirst(t *testing.T) { diff --git a/datastructure/link/singlylink.go b/datastructure/link/singlylink.go index 88d2a94..e189495 100644 --- a/datastructure/link/singlylink.go +++ b/datastructure/link/singlylink.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/duke-git/lancet/datastructure" + "github.com/duke-git/lancet/v2/datastructure" ) // SinglyLink is a linked list. Whose node has a Value generics and Next pointer points to a next node of the link. diff --git a/datastructure/link/singlylink_test.go b/datastructure/link/singlylink_test.go index d2b9e5e..26431ca 100644 --- a/datastructure/link/singlylink_test.go +++ b/datastructure/link/singlylink_test.go @@ -3,7 +3,7 @@ package datastructure import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestSinglyLink_InsertAtFirst(t *testing.T) { diff --git a/datastructure/list/list_test.go b/datastructure/list/list_test.go index b72d8b1..984c622 100644 --- a/datastructure/list/list_test.go +++ b/datastructure/list/list_test.go @@ -3,7 +3,7 @@ package datastructure import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestListData(t *testing.T) { diff --git a/datastructure/queue/arrayqueue_test.go b/datastructure/queue/arrayqueue_test.go index 7b0e2f7..aeed22e 100644 --- a/datastructure/queue/arrayqueue_test.go +++ b/datastructure/queue/arrayqueue_test.go @@ -3,7 +3,7 @@ package datastructure import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestArrayQueue_EnQueue(t *testing.T) { diff --git a/datastructure/queue/circularqueue_test.go b/datastructure/queue/circularqueue_test.go index 5e04c61..aebd04a 100644 --- a/datastructure/queue/circularqueue_test.go +++ b/datastructure/queue/circularqueue_test.go @@ -3,7 +3,7 @@ package datastructure import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestCircularQueue_EnQueue(t *testing.T) { diff --git a/datastructure/queue/linkedqueue.go b/datastructure/queue/linkedqueue.go index 6e988a3..1845ce0 100644 --- a/datastructure/queue/linkedqueue.go +++ b/datastructure/queue/linkedqueue.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/duke-git/lancet/datastructure" + "github.com/duke-git/lancet/v2/datastructure" ) // LinkedQueue implements queue with link list diff --git a/datastructure/queue/linkedqueue_test.go b/datastructure/queue/linkedqueue_test.go index f9cfcd7..8a238d4 100644 --- a/datastructure/queue/linkedqueue_test.go +++ b/datastructure/queue/linkedqueue_test.go @@ -3,7 +3,7 @@ package datastructure import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestLinkedQueue_EnQueue(t *testing.T) { diff --git a/datastructure/set/set_test.go b/datastructure/set/set_test.go index 45acca2..3aa0e19 100644 --- a/datastructure/set/set_test.go +++ b/datastructure/set/set_test.go @@ -3,7 +3,7 @@ package datastructure import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestSet_Add(t *testing.T) { diff --git a/datastructure/stack/arraystack_test.go b/datastructure/stack/arraystack_test.go index 99a77c9..59452f0 100644 --- a/datastructure/stack/arraystack_test.go +++ b/datastructure/stack/arraystack_test.go @@ -3,7 +3,7 @@ package datastructure import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestArrayStack_Push(t *testing.T) { diff --git a/datastructure/stack/linkedstack.go b/datastructure/stack/linkedstack.go index 6cdb96c..fb57a4c 100644 --- a/datastructure/stack/linkedstack.go +++ b/datastructure/stack/linkedstack.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/duke-git/lancet/datastructure" + "github.com/duke-git/lancet/v2/datastructure" ) // LinkedStack implements stack with link list diff --git a/datastructure/stack/linkedstack_test.go b/datastructure/stack/linkedstack_test.go index 9b572f0..65e3b82 100644 --- a/datastructure/stack/linkedstack_test.go +++ b/datastructure/stack/linkedstack_test.go @@ -3,7 +3,7 @@ package datastructure import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestLinkedStack_Push(t *testing.T) { diff --git a/datastructure/tree/bstree.go b/datastructure/tree/bstree.go index a2441d8..6801fcd 100644 --- a/datastructure/tree/bstree.go +++ b/datastructure/tree/bstree.go @@ -3,8 +3,8 @@ package datastructure import ( "math" - "github.com/duke-git/lancet/datastructure" - "github.com/duke-git/lancet/lancetconstraints" + "github.com/duke-git/lancet/v2/datastructure" + "github.com/duke-git/lancet/v2/lancetconstraints" ) // BSTree is a binary search tree data structure in which each node has at most two children, diff --git a/datastructure/tree/bstree_test.go b/datastructure/tree/bstree_test.go index fc54399..7613424 100644 --- a/datastructure/tree/bstree_test.go +++ b/datastructure/tree/bstree_test.go @@ -3,7 +3,7 @@ package datastructure import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) type intComparator struct{} diff --git a/datastructure/tree/tree_internal.go b/datastructure/tree/tree_internal.go index d701384..93f3109 100644 --- a/datastructure/tree/tree_internal.go +++ b/datastructure/tree/tree_internal.go @@ -4,8 +4,8 @@ import ( "fmt" "math" - "github.com/duke-git/lancet/datastructure" - "github.com/duke-git/lancet/lancetconstraints" + "github.com/duke-git/lancet/v2/datastructure" + "github.com/duke-git/lancet/v2/lancetconstraints" ) func preOrderTraverse[T any](node *datastructure.TreeNode[T]) []T { diff --git a/datetime/datetime_test.go b/datetime/datetime_test.go index 728fe97..bb4e2bb 100644 --- a/datetime/datetime_test.go +++ b/datetime/datetime_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestAddDay(t *testing.T) { diff --git a/fileutil/file_test.go b/fileutil/file_test.go index 6ee5956..e748fe2 100644 --- a/fileutil/file_test.go +++ b/fileutil/file_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestIsExist(t *testing.T) { diff --git a/formatter/formatter_test.go b/formatter/formatter_test.go index d2d4f87..6f57c23 100644 --- a/formatter/formatter_test.go +++ b/formatter/formatter_test.go @@ -3,7 +3,7 @@ package formatter import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestComma(t *testing.T) { diff --git a/function/function_test.go b/function/function_test.go index 65f1b3e..c44770c 100644 --- a/function/function_test.go +++ b/function/function_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestAfter(t *testing.T) { diff --git a/function/watcher_test.go b/function/watcher_test.go index 2660a29..a0ab1d8 100644 --- a/function/watcher_test.go +++ b/function/watcher_test.go @@ -3,7 +3,7 @@ package function import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestWatcher(t *testing.T) { diff --git a/go.mod b/go.mod index 29360f4..db6f8bd 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/duke-git/lancet +module github.com/duke-git/lancet/v2 go 1.18 diff --git a/mathutil/mathutil_test.go b/mathutil/mathutil_test.go index e2fd1e1..897ab02 100644 --- a/mathutil/mathutil_test.go +++ b/mathutil/mathutil_test.go @@ -3,7 +3,7 @@ package mathutil import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestExponent(t *testing.T) { diff --git a/netutil/http_test.go b/netutil/http_test.go index 0ef8b28..1b5091d 100644 --- a/netutil/http_test.go +++ b/netutil/http_test.go @@ -6,7 +6,7 @@ import ( "log" "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestHttpGet(t *testing.T) { diff --git a/netutil/net_test.go b/netutil/net_test.go index 7773c37..9458459 100644 --- a/netutil/net_test.go +++ b/netutil/net_test.go @@ -4,7 +4,7 @@ import ( "net" "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestGetInternalIp(t *testing.T) { diff --git a/random/random_test.go b/random/random_test.go index 82fc19a..1ce847c 100644 --- a/random/random_test.go +++ b/random/random_test.go @@ -5,7 +5,7 @@ import ( "regexp" "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestRandString(t *testing.T) { diff --git a/retry/retry_test.go b/retry/retry_test.go index f2f0815..f7d665f 100644 --- a/retry/retry_test.go +++ b/retry/retry_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestRetryFailed(t *testing.T) { diff --git a/slice/slice_test.go b/slice/slice_test.go index 01f27ac..fb95288 100644 --- a/slice/slice_test.go +++ b/slice/slice_test.go @@ -3,7 +3,7 @@ package slice import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestContain(t *testing.T) { diff --git a/strutil/string_test.go b/strutil/string_test.go index 16432b7..9e1dabe 100644 --- a/strutil/string_test.go +++ b/strutil/string_test.go @@ -3,7 +3,7 @@ package strutil import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestCamelCase(t *testing.T) { diff --git a/system/os_test.go b/system/os_test.go index d70813f..5593069 100644 --- a/system/os_test.go +++ b/system/os_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestOsDetection(t *testing.T) { diff --git a/validator/validator_test.go b/validator/validator_test.go index f9f41f9..5a8ed87 100644 --- a/validator/validator_test.go +++ b/validator/validator_test.go @@ -3,7 +3,7 @@ package validator import ( "testing" - "github.com/duke-git/lancet/internal" + "github.com/duke-git/lancet/v2/internal" ) func TestIsAllUpper(t *testing.T) { diff --git a/xerror/xerror_test.go b/xerror/xerror_test.go index 12fff85..d14e5ad 100644 --- a/xerror/xerror_test.go +++ b/xerror/xerror_test.go @@ -1,9 +1,10 @@ package xerror import ( - "github.com/duke-git/lancet/internal" "strconv" "testing" + + "github.com/duke-git/lancet/v2/internal" ) func TestUnwrap(t *testing.T) {