Skip to content

Commit 4869416

Browse files
authored
Rm/add static check (#104)
1 parent 2c282a8 commit 4869416

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

.github/linters/.golangci.yml

+18
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
issues:
2+
include:
3+
- EXC0001
4+
- EXC0002
5+
- EXC0003
6+
- EXC0004
7+
- EXC0005
8+
- EXC0006
9+
- EXC0007
10+
- EXC0008
11+
- EXC0009
12+
- EXC0010
13+
- EXC0011
14+
- EXC0012
15+
- EXC0013
16+
- EXC0014
217
exclude-rules:
318
- path: /
419
linters:
@@ -20,3 +35,6 @@ issues:
2035

2136
linters:
2237
enable-all: true
38+
enable:
39+
- revive
40+
- misspell

heap/heap_sort.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ type (
1818
}
1919
)
2020

21-
// HeapSort solves the problem in O(n*Log n) time and O(n) space.
22-
func HeapSort(list []int) []int {
21+
// Sort solves the problem in O(n*Log n) time and O(n) space.
22+
func Sort(list []int) []int {
2323
sorted := []int{}
2424
heap := NewMinHeap()
2525
for _, val := range list {

heap/heap_sort_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import (
77
)
88

99
/*
10-
TestHeapSort tests solution(s) with the following signature and problem description:
10+
TestSort tests solution(s) with the following signature and problem description:
1111
1212
func HeapSort(list []int) []int
1313
1414
Given a list of integers like {3,1,2}, return a sorted set like {1,2,3} using Heap Sort.
1515
*/
16-
func TestHeapSort(t *testing.T) {
16+
func TestSort(t *testing.T) {
1717
tests := []struct {
1818
list []int
1919
sorted []int
@@ -28,7 +28,7 @@ func TestHeapSort(t *testing.T) {
2828
}
2929

3030
for i, test := range tests {
31-
if got := HeapSort(test.list); !reflect.DeepEqual(got, test.sorted) {
31+
if got := Sort(test.list); !reflect.DeepEqual(got, test.sorted) {
3232
t.Fatalf("Failed test case #%d. Want %v got %v", i, test.sorted, got)
3333
}
3434
}

0 commit comments

Comments
 (0)