diff --git a/.github/linters/.golangci.yml b/.github/linters/.golangci.yml index f4a2e5d..9c182e3 100644 --- a/.github/linters/.golangci.yml +++ b/.github/linters/.golangci.yml @@ -1,4 +1,19 @@ issues: + include: + - EXC0001 + - EXC0002 + - EXC0003 + - EXC0004 + - EXC0005 + - EXC0006 + - EXC0007 + - EXC0008 + - EXC0009 + - EXC0010 + - EXC0011 + - EXC0012 + - EXC0013 + - EXC0014 exclude-rules: - path: / linters: @@ -20,3 +35,6 @@ issues: linters: enable-all: true + enable: + - revive + - misspell diff --git a/heap/heap_sort.go b/heap/heap_sort.go index 1b4e4cc..fa05cfa 100644 --- a/heap/heap_sort.go +++ b/heap/heap_sort.go @@ -18,8 +18,8 @@ type ( } ) -// HeapSort solves the problem in O(n*Log n) time and O(n) space. -func HeapSort(list []int) []int { +// Sort solves the problem in O(n*Log n) time and O(n) space. +func Sort(list []int) []int { sorted := []int{} heap := NewMinHeap() for _, val := range list { diff --git a/heap/heap_sort_test.go b/heap/heap_sort_test.go index 6a8595b..f2df686 100644 --- a/heap/heap_sort_test.go +++ b/heap/heap_sort_test.go @@ -7,13 +7,13 @@ import ( ) /* -TestHeapSort tests solution(s) with the following signature and problem description: +TestSort tests solution(s) with the following signature and problem description: func HeapSort(list []int) []int Given a list of integers like {3,1,2}, return a sorted set like {1,2,3} using Heap Sort. */ -func TestHeapSort(t *testing.T) { +func TestSort(t *testing.T) { tests := []struct { list []int sorted []int @@ -28,7 +28,7 @@ func TestHeapSort(t *testing.T) { } for i, test := range tests { - if got := HeapSort(test.list); !reflect.DeepEqual(got, test.sorted) { + if got := Sort(test.list); !reflect.DeepEqual(got, test.sorted) { t.Fatalf("Failed test case #%d. Want %v got %v", i, test.sorted, got) } }