mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-11-22 20:20:19 +01:00
min go version 1.18, include tip for test (#532)
* min go version 1.18, include tip for test * lint * lint * lint * lint * lint * lint * lint * lint * lint * lint * lint * lint * lint
This commit is contained in:
parent
193f944829
commit
9f1fe62e05
2 changed files with 19 additions and 9 deletions
26
.github/workflows/test.yml
vendored
26
.github/workflows/test.yml
vendored
|
@ -13,16 +13,27 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
go_version:
|
go_version:
|
||||||
- 1.15.x
|
- '1.18'
|
||||||
- 1.16.x
|
- '1.19'
|
||||||
- 1.17.x
|
- '1.20'
|
||||||
- 1.18.X
|
- tip
|
||||||
name: Test with ${{ matrix.go_version }}
|
name: Test with ${{ matrix.go_version }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-go@v1
|
- name: Install Go ${{ matrix.go_version }}
|
||||||
|
if: ${{ matrix.go_version != 'tip' }}
|
||||||
|
uses: actions/setup-go@master
|
||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.go_version }}
|
go-version: ${{ matrix.go_version }}
|
||||||
|
check-latest: true
|
||||||
|
- name: Install Go ${{ matrix.go_version }}
|
||||||
|
if: ${{ matrix.go_version == 'tip' }}
|
||||||
|
run: |
|
||||||
|
curl -sL https://storage.googleapis.com/go-build-snap/go/linux-amd64/$(git ls-remote https://github.com/golang/go.git HEAD | awk '{print $1;}').tar.gz -o gotip.tar.gz
|
||||||
|
ls -lah gotip.tar.gz
|
||||||
|
mkdir -p ~/sdk/gotip
|
||||||
|
tar -C ~/sdk/gotip -xzf gotip.tar.gz
|
||||||
|
echo "PATH=$HOME/go/bin:$HOME/sdk/gotip/bin/:$PATH" >> $GITHUB_ENV
|
||||||
- name: Vet and test
|
- name: Vet and test
|
||||||
run: |
|
run: |
|
||||||
go version
|
go version
|
||||||
|
@ -33,9 +44,10 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-go@v1
|
- uses: actions/setup-go@master
|
||||||
with:
|
with:
|
||||||
go-version: 1.18
|
go-version: '1.20'
|
||||||
|
check-latest: true
|
||||||
- name: golangci-lint
|
- name: golangci-lint
|
||||||
uses: golangci/golangci-lint-action@v2
|
uses: golangci/golangci-lint-action@v2
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -466,8 +466,6 @@ func (s *Server) Run() {
|
||||||
r.HandleFunc("/{action:(?:download|get|inline)}/{token}/{filename}", s.headHandler).Methods("HEAD")
|
r.HandleFunc("/{action:(?:download|get|inline)}/{token}/{filename}", s.headHandler).Methods("HEAD")
|
||||||
|
|
||||||
r.HandleFunc("/{token}/{filename}", s.previewHandler).MatcherFunc(func(r *http.Request, rm *mux.RouteMatch) (match bool) {
|
r.HandleFunc("/{token}/{filename}", s.previewHandler).MatcherFunc(func(r *http.Request, rm *mux.RouteMatch) (match bool) {
|
||||||
match = false
|
|
||||||
|
|
||||||
// The file will show a preview page when opening the link in browser directly or
|
// The file will show a preview page when opening the link in browser directly or
|
||||||
// from external link. If the referer url path and current path are the same it will be
|
// from external link. If the referer url path and current path are the same it will be
|
||||||
// downloaded.
|
// downloaded.
|
||||||
|
|
Loading…
Reference in a new issue