File tree 4 files changed +76
-58
lines changed
4 files changed +76
-58
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ name : Go Matrix
2
+ on : [push, pull_request]
3
+
4
+ jobs :
5
+
6
+ cross :
7
+ name : Go
8
+ runs-on : ${{ matrix.os }}
9
+ env :
10
+ CGO_ENABLED : 0
11
+
12
+ strategy :
13
+ matrix :
14
+ go-version : [ oldstable, stable ]
15
+ os : [ubuntu-latest, macos-latest, windows-latest]
16
+
17
+ steps :
18
+ # https://github.com/marketplace/actions/checkout
19
+ - name : Checkout code
20
+ uses : actions/checkout@v4
21
+
22
+ # https://github.com/marketplace/actions/setup-go-environment
23
+ - name : Set up Go ${{ matrix.go-version }}
24
+ uses : actions/setup-go@v5
25
+ with :
26
+ go-version : ${{ matrix.go-version }}
27
+
28
+ - name : Test
29
+ run : go test -v -cover ./...
30
+
31
+ - name : Build
32
+ run : go build -v -ldflags "-s -w" -trimpath
Original file line number Diff line number Diff line change
1
+ name : Main
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ pull_request :
8
+
9
+ jobs :
10
+
11
+ main :
12
+ name : Main Process
13
+ runs-on : ubuntu-latest
14
+ env :
15
+ GO_VERSION : stable
16
+ GOLANGCI_LINT_VERSION : v1.57.0
17
+ CGO_ENABLED : 0
18
+
19
+ steps :
20
+ # https://github.com/marketplace/actions/checkout
21
+ - name : Check out code
22
+ uses : actions/checkout@v4
23
+ with :
24
+ fetch-depth : 0
25
+
26
+ # https://github.com/marketplace/actions/setup-go-environment
27
+ - name : Set up Go ${{ env.GO_VERSION }}
28
+ uses : actions/setup-go@v5
29
+ with :
30
+ go-version : ${{ env.GO_VERSION }}
31
+
32
+ - name : Check and get dependencies
33
+ run : |
34
+ go mod download
35
+ go mod tidy
36
+ git diff --exit-code go.mod
37
+ git diff --exit-code go.sum
38
+
39
+ # https://golangci-lint.run/usage/install#other-ci
40
+ - name : Install golangci-lint ${{ env.GOLANGCI_LINT_VERSION }}
41
+ run : curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}
42
+
43
+ - name : Make
44
+ run : make
Original file line number Diff line number Diff line change 5
5
"go/token"
6
6
"go/types"
7
7
"regexp"
8
- "strconv"
9
8
"strings"
10
9
"sync"
11
10
@@ -222,37 +221,6 @@ func (r *runner) collectHttpTyps(pssa *buildssa.SSA) {
222
221
}
223
222
}
224
223
225
- func (r * runner ) noImportedContextAndHttp (f * ssa.Function ) (ret bool ) {
226
- if ! f .Pos ().IsValid () {
227
- return false
228
- }
229
-
230
- file := analysisutil .File (r .pass , f .Pos ())
231
- if file == nil {
232
- return false
233
- }
234
-
235
- if skip , has := r .skipFile [file ]; has {
236
- return skip
237
- }
238
- defer func () {
239
- r .skipFile [file ] = ret
240
- }()
241
-
242
- for _ , impt := range file .Imports {
243
- path , err := strconv .Unquote (impt .Path .Value )
244
- if err != nil {
245
- continue
246
- }
247
- path = analysisutil .RemoveVendor (path )
248
- if path == ctxPkg || path == httpPkg {
249
- return false
250
- }
251
- }
252
-
253
- return true
254
- }
255
-
256
224
func (r * runner ) checkIsEntry (f * ssa.Function ) (ret entryType ) {
257
225
// if r.noImportedContextAndHttp(f) {
258
226
// return EntryNormal
You can’t perform that action at this time.
0 commit comments