diff options
author | 2022-04-02 15:40:09 +0200 | |
---|---|---|
committer | 2022-04-02 15:40:09 +0200 | |
commit | 03d7c75ebf1b81b12ec21f95eef1c07b265ff939 (patch) | |
tree | 511724f53946563a3b7ba1307d25f5bda98ac3a8 /internal/processing | |
parent | [documentation] Add third-party packaging to documentation (#443) (diff) | |
download | gotosocial-03d7c75ebf1b81b12ec21f95eef1c07b265ff939.tar.xz |
[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
Diffstat (limited to 'internal/processing')
-rw-r--r-- | internal/processing/fromcommon.go | 7 | ||||
-rw-r--r-- | internal/processing/streaming/streamdelete.go | 7 |
2 files changed, 9 insertions, 5 deletions
diff --git a/internal/processing/fromcommon.go b/internal/processing/fromcommon.go index 8e7f20145..1b470918d 100644 --- a/internal/processing/fromcommon.go +++ b/internal/processing/fromcommon.go @@ -365,14 +365,13 @@ func (p *processor) timelineStatus(ctx context.Context, status *gtsmodel.Status) // read any errors that come in from the async functions errs := []string{} - go func() { + go func(errs []string) { for range errors { - e := <-errors - if e != nil { + if e := <-errors; e != nil { errs = append(errs, e.Error()) } } - }() + }(errs) // wait til all functions have returned and then close the error channel wg.Wait() diff --git a/internal/processing/streaming/streamdelete.go b/internal/processing/streaming/streamdelete.go index c9c099b46..3d4efb7a7 100644 --- a/internal/processing/streaming/streamdelete.go +++ b/internal/processing/streaming/streamdelete.go @@ -31,7 +31,12 @@ func (p *processor) StreamDelete(statusID string) error { // get all account IDs with open streams accountIDs := []string{} p.streamMap.Range(func(k interface{}, _ interface{}) bool { - accountIDs = append(accountIDs, k.(string)) + key, ok := k.(string) + if !ok { + panic("streamMap key was not a string (account id)") + } + + accountIDs = append(accountIDs, key) return true }) |