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)