From aa7a32efe03ba0e4457b1f1ae2d947bb197b2a8f Mon Sep 17 00:00:00 2001 From: reanon <793584285@qq.com> Date: Sat, 26 Nov 2022 01:17:48 +0800 Subject: [PATCH] fix(go): fix support basic pkg --- codes/go/chapter_searching/linear_search_test.go | 2 +- codes/go/pkg/list_node.go | 4 ++-- codes/go/pkg/list_node_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/codes/go/chapter_searching/linear_search_test.go b/codes/go/chapter_searching/linear_search_test.go index 7f4915883..ffb800dda 100644 --- a/codes/go/chapter_searching/linear_search_test.go +++ b/codes/go/chapter_searching/linear_search_test.go @@ -18,7 +18,7 @@ func TestLinearSearch(t *testing.T) { t.Log("目标元素 3 的索引 = ", index) // 在链表中执行线性查找 - head := ArrayToLinkedListLinkedList(nums) + head := ArrayToLinkedList(nums) node := linerSearchLinkedList(head, target) t.Log("目标结点值 3 的对应结点对象为 ", node) } diff --git a/codes/go/pkg/list_node.go b/codes/go/pkg/list_node.go index f7be3ad04..6795111ea 100644 --- a/codes/go/pkg/list_node.go +++ b/codes/go/pkg/list_node.go @@ -24,8 +24,8 @@ func NewListNode(v int) *ListNode { } } -// ArrayToLinkedListLinkedList Generate a linked list with an array -func ArrayToLinkedListLinkedList(arr []int) *ListNode { +// ArrayToLinkedList Generate a linked list with an array +func ArrayToLinkedList(arr []int) *ListNode { // dummy header of linked list dummy := NewListNode(0) node := dummy diff --git a/codes/go/pkg/list_node_test.go b/codes/go/pkg/list_node_test.go index 5eee93ce7..5bc33d99d 100644 --- a/codes/go/pkg/list_node_test.go +++ b/codes/go/pkg/list_node_test.go @@ -8,7 +8,7 @@ import "testing" func TestListNode(t *testing.T) { arr := []int{2, 3, 5, 6, 7} - head := ArrayToLinkedListLinkedList(arr) + head := ArrayToLinkedList(arr) PrintLinkedList(head) node := GetListNode(head, 5)