mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 00:01:10 +08:00
fix typo & update test workflow
This commit is contained in:
parent
d232d1cf12
commit
0c04bb1355
3 changed files with 10 additions and 10 deletions
2
.github/workflows/build-dev.yml
vendored
2
.github/workflows/build-dev.yml
vendored
|
|
@ -73,7 +73,7 @@ jobs:
|
||||||
GOOS: ${{ matrix.goos }}
|
GOOS: ${{ matrix.goos }}
|
||||||
GOARCH: ${{ matrix.goarch }}
|
GOARCH: ${{ matrix.goarch }}
|
||||||
run: |
|
run: |
|
||||||
go test .
|
go test ./..
|
||||||
- name: 编译
|
- name: 编译
|
||||||
env:
|
env:
|
||||||
GOOS: ${{ matrix.goos }}
|
GOOS: ${{ matrix.goos }}
|
||||||
|
|
|
||||||
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
|
@ -74,7 +74,7 @@ jobs:
|
||||||
GOOS: ${{ matrix.goos }}
|
GOOS: ${{ matrix.goos }}
|
||||||
GOARCH: ${{ matrix.goarch }}
|
GOARCH: ${{ matrix.goarch }}
|
||||||
run: |
|
run: |
|
||||||
go test .
|
go test ./..
|
||||||
- name: 编译
|
- name: 编译
|
||||||
env:
|
env:
|
||||||
GOOS: ${{ matrix.goos }}
|
GOOS: ${{ matrix.goos }}
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
githubPrefix = "https://github.com/"
|
|
||||||
rawPrefix = "https://raw.githubusercontent.com/"
|
|
||||||
gistPrefix = "https://gist.github.com/"
|
|
||||||
gistContentPrefix = "https://gist.githubusercontent.com/"
|
|
||||||
apiPrefix = "https://api.github.com/"
|
|
||||||
githubPrefixLen int
|
githubPrefixLen int
|
||||||
rawPrefixLen int
|
rawPrefixLen int
|
||||||
gistPrefixLen int
|
gistPrefixLen int
|
||||||
|
|
@ -22,8 +17,13 @@ var (
|
||||||
apiPrefixLen int
|
apiPrefixLen int
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
const (
|
||||||
releasesDownloadSinnipt = "releases/download/"
|
githubPrefix = "https://github.com/"
|
||||||
|
rawPrefix = "https://raw.githubusercontent.com/"
|
||||||
|
gistPrefix = "https://gist.github.com/"
|
||||||
|
gistContentPrefix = "https://gist.githubusercontent.com/"
|
||||||
|
apiPrefix = "https://api.github.com/"
|
||||||
|
releasesDownloadSnippet = "releases/download/"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
@ -66,7 +66,7 @@ func Matcher(rawPath string, cfg *config.Config) (string, string, string, *GHPro
|
||||||
var matcher string
|
var matcher string
|
||||||
switch action {
|
switch action {
|
||||||
case "releases":
|
case "releases":
|
||||||
if strings.HasPrefix(remaining, releasesDownloadSinnipt) {
|
if strings.HasPrefix(remaining, releasesDownloadSnippet) {
|
||||||
matcher = "releases"
|
matcher = "releases"
|
||||||
} else {
|
} else {
|
||||||
return "", "", "", NewErrorWithStatusLookup(400, "malformed github path: not a releases download url")
|
return "", "", "", NewErrorWithStatusLookup(400, "malformed github path: not a releases download url")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue