1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

upgrade go module v2

This commit is contained in:
dudaodong
2022-03-17 10:57:35 +08:00
parent 1434e00712
commit 50c6e51393
42 changed files with 46 additions and 45 deletions

View File

@@ -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) {

View File

@@ -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

View File

@@ -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}

View File

@@ -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 {

View File

@@ -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)

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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.

View File

@@ -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) {

View File

@@ -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.

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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

View File

@@ -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) {

View File

@@ -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,

View File

@@ -3,7 +3,7 @@ package datastructure
import (
"testing"
"github.com/duke-git/lancet/internal"
"github.com/duke-git/lancet/v2/internal"
)
type intComparator struct{}

View File

@@ -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 {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

2
go.mod
View File

@@ -1,3 +1,3 @@
module github.com/duke-git/lancet
module github.com/duke-git/lancet/v2
go 1.18

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {