[chore] Update Go version to 1.18 (#444)

* linting with new golangci-lint version

* update go to 1.18

* bump versions in drone.yml

* use new runtime/debug package for version info

* remove Commit build flag from goreleaser

* remove mock commit + version from build script

* go fmt

* add dummy version env flag to test container

* install git in golang container for testing

* only set versionString if Version is defined
This commit is contained in:
tobi
2022-04-02 15:40:09 +02:00
committed by GitHub
parent 906981a718
commit 03d7c75ebf
16 changed files with 87 additions and 246 deletions

View File

@@ -46,7 +46,13 @@ func (m *mentionDB) getMentionCached(id string) (*gtsmodel.Mention, bool) {
if !ok {
return nil, false
}
return v.(*gtsmodel.Mention), true
mention, ok := v.(*gtsmodel.Mention)
if !ok {
panic("mention cache entry was not a mention")
}
return mention, true
}
func (m *mentionDB) putMentionCache(mention *gtsmodel.Mention) {

View File

@@ -114,7 +114,13 @@ func (n *notificationDB) getNotificationCache(id string) (*gtsmodel.Notification
if !ok {
return nil, false
}
return v.(*gtsmodel.Notification), true
notif, ok := v.(*gtsmodel.Notification)
if !ok {
panic("notification cache entry was not a notification")
}
return notif, true
}
func (n *notificationDB) putNotificationCache(notif *gtsmodel.Notification) {