Skip to content

Commit

Permalink
chore: add go format check and update go version
Browse files Browse the repository at this point in the history
- go 1.18 has reached end of life, use go 1.20
- fix formatting errors

Signed-off-by: Avinal Kumar <[email protected]>
  • Loading branch information
avinal committed Jun 16, 2023
1 parent 448684e commit f96cb3a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

jobs:

Expand All @@ -17,9 +18,20 @@ jobs:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.18
go-version: '1.20'
check-latest: true
cache: true

- name: Check Formatting
run: |
find . -name '*.go' -not -path './vendor/*' | xargs gofmt -d -s > gofmt.out
if [[ -s gofmt.out ]]; then
echo "The following files were found to have formatting deviations:"
cat gofmt.out
exit 1
fi
- name: Build
run: go build -v ./...
Expand Down
2 changes: 1 addition & 1 deletion pkg/authenticate/doc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-FileCopyrightText: 2023 Kavya Shukla <[email protected]>
// SPDX-License-Identifier: GPL-2.0-only

//Package authenticate is build to authenticate the API.
// Package authenticate is build to authenticate the API.
package authenticate
2 changes: 1 addition & 1 deletion pkg/models/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
// SPDX-License-Identifier: GPL-2.0-only

// Package models is made to connect the database and to store the structs of
//different data.
// different data.
package models
1 change: 0 additions & 1 deletion pkg/models/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

package models

//
type License struct {
Shortname string `json:"rf_shortname" gorm:"primary_key"`
Fullname string `json:"rf_fullname"`
Expand Down

0 comments on commit f96cb3a

Please sign in to comment.