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

Code improvement, fixed staticcheck and linter warnings #32

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ca97c8f
chore: dependency management using go module
pilinux Dec 4, 2022
d32b03f
fix: go-staticcheck warnings
pilinux Dec 4, 2022
d39cdc9
fix: linter warnings
pilinux Dec 4, 2022
bb5e1f2
chore: call `Secret` function
pilinux Dec 4, 2022
f68757b
chore: error var for token mismatch
pilinux Dec 4, 2022
2ef3a10
chore: reduce calling `validBackOffTime`
pilinux Dec 4, 2022
4317c14
feat: functions to generate recovery codes
pilinux Dec 4, 2022
a440d35
feat: get the hash function and number of digits
pilinux Dec 4, 2022
a08c6c3
feat: expose URL
pilinux Dec 4, 2022
09cca30
Create codeql.yml
pilinux Dec 4, 2022
7338982
Create dependabot.yml
pilinux Dec 4, 2022
f9ee9ac
chore: github action files added
pilinux Dec 5, 2022
b99c334
Update README.md
pilinux Dec 5, 2022
16866b8
updated dependencies
pilinux Nov 13, 2023
9f9b444
typo fix + prettify
pilinux Nov 13, 2023
aeb0b66
ci: update github actions
pilinux Nov 13, 2023
14b248e
replace `cryptoengine` package
pilinux Nov 13, 2023
acadc1c
optimised for go pkg docs
pilinux Nov 13, 2023
c53a307
Bump actions/setup-go from 4 to 5 (#8)
dependabot[bot] Mar 19, 2024
a830763
Bump github/codeql-action from 2 to 3 (#9)
dependabot[bot] Mar 19, 2024
d8deeb2
Bump golangci/golangci-lint-action from 3 to 4 (#16)
dependabot[bot] Mar 19, 2024
359c2cb
Bump actions/cache from 3.3.2 to 4.0.2 (#19)
dependabot[bot] Mar 19, 2024
597c171
Bump github.com/pilinux/cryptoengine from 0.1.1 to 0.1.2 (#18)
dependabot[bot] Mar 19, 2024
c3ca413
Bump golang.org/x/sync from 0.5.0 to 0.6.0 (#11)
dependabot[bot] Mar 19, 2024
1021acb
Bump golangci/golangci-lint-action from 4 to 5 (#22)
dependabot[bot] Apr 27, 2024
5e3d264
ci: actions/cache v4.0.2 -> v4
pilinux Apr 27, 2024
a2df29d
Bump github.com/pilinux/cryptoengine from 0.1.2 to 0.1.3 (#23)
dependabot[bot] Apr 27, 2024
3ab8088
Bump golang.org/x/sync from 0.6.0 to 0.7.0 (#21)
dependabot[bot] Apr 27, 2024
e8be9f8
Bump golangci/golangci-lint-action from 5 to 6 (#24)
dependabot[bot] May 15, 2024
eb0797b
Bump golang.org/x/crypto from 0.22.0 to 0.23.0 (#25)
dependabot[bot] May 15, 2024
77280a4
Bump github.com/pilinux/cryptoengine from 0.1.3 to 0.1.4 (#26)
dependabot[bot] May 17, 2024
47f125e
Bump github.com/pilinux/cryptoengine from 0.1.4 to 0.1.5 (#28)
dependabot[bot] Jun 21, 2024
2e8fb01
set minimum required go version 1.20
pilinux Aug 7, 2024
263811d
Bump github.com/pilinux/cryptoengine from 0.1.6 to 0.1.7 (#33)
dependabot[bot] Oct 1, 2024
5b212b5
Bump golang.org/x/crypto from 0.27.0 to 0.30.0 (#38)
dependabot[bot] Dec 7, 2024
3d4db00
Bump golang.org/x/sync from 0.8.0 to 0.10.0 (#37)
dependabot[bot] Dec 7, 2024
7ed5652
Bump github.com/pilinux/cryptoengine from 0.1.7 to 0.1.9 (#41)
dependabot[bot] Dec 22, 2024
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
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
# Allow up to 10 open pull requests for dependencies
open-pull-requests-limit: 10

- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
79 changes: 79 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches:
- "main"
pull_request:
# The branches below must be a subset of the branches above
branches:
- "main"
schedule:
- cron: "19 7 * * 2"

permissions:
contents: read

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language:
- "go"
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, 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@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
78 changes: 78 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Go

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Cache
uses: actions/cache@v4
with:
path: |
**/go.sum
**/go.mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.20.14
- run: go version

- name: Examine source code for Linux AMD
run: GOOS=linux GOARCH=amd64 go vet -v ./...

- name: Examine source code for MacOS AMD
run: GOOS=darwin GOARCH=amd64 go vet -v ./...

- name: Examine source code for Windows AMD
run: GOOS=windows GOARCH=amd64 go vet -v ./...

- name: Examine source code for Linux ARM
run: GOOS=linux GOARCH=arm64 go vet -v ./...

- name: Examine source code for MacOS ARM
run: GOOS=darwin GOARCH=arm64 go vet -v ./...

- name: Examine source code for Windows ARM
run: GOOS=windows GOARCH=arm64 go vet -v ./...

- name: Test source code
run: go test -v -cover ./...

- name: Build for Linux AMD
run: GOOS=linux GOARCH=amd64 go build -v ./...

- name: Build for MacOS AMD
run: GOOS=darwin GOARCH=amd64 go build -v ./...

- name: Build for Windows AMD
run: GOOS=windows GOARCH=amd64 go build -v ./...

- name: Build for Linux ARM
run: GOOS=linux GOARCH=arm64 go build -v ./...

- name: Build for MacOS ARM
run: GOOS=darwin GOARCH=arm64 go build -v ./...

- name: Build for Windows ARM
run: GOOS=windows GOARCH=arm64 go build -v ./...
58 changes: 58 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: golangci-lint
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
pull-requests: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Cache
uses: actions/cache@v4
with:
path: |
**/go.sum
**/go.mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.20.14
- run: go version

- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: latest

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
args: --timeout 3m --verbose

# Optional: show only new issues if it's a pull request. The default value is `false`.
only-new-issues: true

# Optional: if set to true then the action don't cache or restore ~/go/pkg.
# skip-pkg-cache: true

# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

59 changes: 0 additions & 59 deletions Godeps/Godeps.json

This file was deleted.

5 changes: 0 additions & 5 deletions Godeps/Readme

This file was deleted.

Loading