Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: update to golang v1.21 #96

Merged
merged 20 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gomod"
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10
interval: "weekly"
groups:
all:
patterns:
- "*"

- package-ecosystem: "github-actions"
# Maintain dependencies for Golang
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"

interval: "monthly"
groups:
all:
patterns:
- "*"
2 changes: 0 additions & 2 deletions .github/linters/.dockerfilelintrc

This file was deleted.

1 change: 0 additions & 1 deletion .github/linters/.golangci.yml

This file was deleted.

18 changes: 9 additions & 9 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,20 @@ jobs:
steps:
- name: Check out code base
if: github.event_name == 'push' || github.event_name == 'schedule'
uses: actions/checkout@v4
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
fetch-depth: 0

- name: Check out code base
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/codeql-config.yml
Expand All @@ -71,7 +71,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -85,29 +85,29 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3

nancy:
name: Sonatype Nancy
runs-on: ubuntu-latest
steps:
- name: Check out code base
if: github.event_name == 'push' || github.event_name == 'schedule'
uses: actions/checkout@v4
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
fetch-depth: 0

- name: Check out code base
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Go 1.x
uses: actions/setup-go@v4
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 #v5
with:
go-version: ^1.16
go-version: ^1.21

- name: Write Go module list
run: go list -json -m all > go.list
Expand Down
122 changes: 31 additions & 91 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,117 +2,57 @@ name: Linter

on:
push:
branches:
- '**'
branches: [ master ]
pull_request:
branches:
- '**'
types: [ opened, synchronize, reopened ]
branches: [ master ]

permissions: write-all
permissions:
contents: read

jobs:
lint:
golangci:
runs-on: ubuntu-latest
steps:
- name: Check out code base
if: github.event_name == 'push'
uses: actions/checkout@v4
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 #v5
with:
fetch-depth: 0

- name: Check out code base
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
go-version-file: go.mod
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc #v3.7.0
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
version: latest
only-new-issues: true

super-linter-markdown:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1

- name: Lint Code Base
uses: github/super-linter@v4
Monirzadeh marked this conversation as resolved.
Show resolved Hide resolved
- name: Super-linter
uses: super-linter/super-linter@a8150b40c89574adb5f68bf9502b890a236a06b3 #v5.7.2
env:
DEFAULT_BRANCH: 'main'
VALIDATE_MARKDOWN: true
VALIDATE_DOCKERFILE: true
VALIDATE_BASH: true
VALIDATE_BASH_EXEC: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

go:
reviewdog-misspell:
runs-on: ubuntu-latest
steps:
- name: Check out code base
if: github.event_name == 'push'
uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- name: misspell
uses: reviewdog/action-misspell@06d6a480724fa783c220081bbc22336a78dbbe82 #v1.15.0
with:
fetch-depth: 0

- name: Check out code base
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Golang linter
uses: golangci/[email protected]
github_token: ${{ secrets.github_token }}
locale: "US"

shellcheck:
reviewdog-alex:
runs-on: ubuntu-latest
steps:
- name: Check out code base
if: github.event_name == 'push'
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check out code base
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Run shellcheck with reviewdog
uses: reviewdog/action-shellcheck@v1

misspell:
runs-on: ubuntu-latest
steps:
- name: Check out code base
if: github.event_name == 'push'
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check out code base
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Run misspell with reviewdog
uses: reviewdog/action-misspell@v1

alex:
runs-on: ubuntu-latest
steps:
- name: Check out code base
if: github.event_name == 'push'
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check out code base
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Run alex with reviewdog
uses: reviewdog/action-alex@v1
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- uses: reviewdog/action-alex@83d6502258513773127065a4d8d53c2c84697579 #v1.7.0

goreportcard:
if: ${{ github.ref == 'refs/heads/main' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Mark stale issues and pull requests
uses: actions/stale@v4
uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e #v9
with:
repo-token: ${{ github.token }}
exempt-issue-labels: "enhancement,question,help wanted,bug"
Expand Down
76 changes: 0 additions & 76 deletions .golangci.yml

This file was deleted.

5 changes: 2 additions & 3 deletions archiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"io"
"io/ioutil"
"net/http"
nurl "net/url"
"os"
Expand Down Expand Up @@ -136,7 +135,7 @@ func (arc *Archiver) Archive(ctx context.Context, req Request) ([]byte, string,
// Check the type of the downloaded file.
// If it's not HTML, just return it as it is.
if !strings.HasPrefix(contentType, "text/html") {
content, err := ioutil.ReadAll(req.Input)
content, err := io.ReadAll(req.Input)
return content, contentType, err
}

Expand Down Expand Up @@ -219,7 +218,7 @@ func (arc *Archiver) transform(uri string, content []byte, contentType string) s
path = filepath.Join(arc.WrapDirectory, name)
}

if err := ioutil.WriteFile(path, content, 0600); err != nil {
if err := os.WriteFile(path, content, 0600); err != nil {
// Fallback to creating data URL
if contentType == "" {
contentType = http.DetectContentType(content)
Expand Down
Loading
Loading