Update Go in actions and add go vet to pre-commit
This commit is contained in:
5
.github/workflows/go.yml
vendored
5
.github/workflows/go.yml
vendored
@@ -8,7 +8,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
go-version: [1.18]
|
||||
go-version: [1.19]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
@@ -17,6 +17,9 @@ jobs:
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
|
||||
- name: Install libolm
|
||||
run: sudo apt-get install libolm-dev libolm3
|
||||
|
||||
- name: Install goimports
|
||||
run: |
|
||||
go install golang.org/x/tools/cmd/goimports@latest
|
||||
|
||||
@@ -12,3 +12,4 @@ repos:
|
||||
rev: v1.0.0-beta.5
|
||||
hooks:
|
||||
- id: go-imports-repo
|
||||
- id: go-vet-repo-mod
|
||||
|
||||
@@ -33,7 +33,6 @@ func (mq *MessageQuery) scanAll(rows *sql.Rows, err error) []*Message {
|
||||
if err != nil {
|
||||
mq.log.Warnfln("Failed to query many messages: %v", err)
|
||||
panic(err)
|
||||
return nil
|
||||
} else if rows == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ func (up UserPortal) Scan(l log.Logger, row dbutil.Scannable) *UserPortal {
|
||||
if err != nil {
|
||||
l.Errorln("Error scanning user portal:", err)
|
||||
panic(err)
|
||||
return nil
|
||||
}
|
||||
up.Timestamp = time.UnixMilli(ts)
|
||||
return &up
|
||||
@@ -49,7 +48,6 @@ func (u *User) GetPortals() []UserPortal {
|
||||
if err != nil {
|
||||
u.log.Errorln("Failed to get portals:", err)
|
||||
panic(err)
|
||||
return nil
|
||||
}
|
||||
return u.scanUserPortals(rows)
|
||||
}
|
||||
|
||||
@@ -128,9 +128,9 @@ type astDiscordCustomEmoji struct {
|
||||
|
||||
func (n *astDiscordCustomEmoji) String() string {
|
||||
if n.animated {
|
||||
return fmt.Sprintf("<a%s%s>", n.name, n.id)
|
||||
return fmt.Sprintf("<a%s%d>", n.name, n.id)
|
||||
}
|
||||
return fmt.Sprintf("<%s%s>", n.name, n.id)
|
||||
return fmt.Sprintf("<%s%d>", n.name, n.id)
|
||||
}
|
||||
|
||||
type discordTagParser struct{}
|
||||
|
||||
1
user.go
1
user.go
@@ -644,7 +644,6 @@ func (user *User) handleGuildRoles(guildID string, newRoles []*discordgo.Role) {
|
||||
if err != nil {
|
||||
user.log.Errorln("Failed to start transaction for guild role sync:", err)
|
||||
panic(err)
|
||||
return
|
||||
}
|
||||
for _, role := range newRoles {
|
||||
dbRole, changed := user.discordRoleToDB(guildID, role, existingRoleMap[role.ID])
|
||||
|
||||
Reference in New Issue
Block a user