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

Update go #84

Merged
merged 2 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: golangci/golangci-lint-action@v3
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: 'v1.54.2'
version: 'v1.57.2'

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
22 changes: 21 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ linters:
- govet
- ineffassign
- staticcheck
- typecheck
- unused
# disabled by default
- asasalint
Expand All @@ -19,6 +18,7 @@ linters:
- bodyclose
- containedctx
- contextcheck
- copyloopvar
- cyclop
# - deadcode [deprecated]
- decorder
Expand All @@ -43,6 +43,7 @@ linters:
- gocheckcompilerdirectives
# - gochecknoglobals # globals are ok
# - gochecknoinits # init() is ok
- gochecksumtype
- gocognit
- goconst
- gocritic
Expand All @@ -64,8 +65,10 @@ linters:
- grouper
# - ifshort [deprecated]
- importas
- inamedparam
- interfacebloat
# - interfacer [deprecated]
- intrange
# - ireturn # return interfaces are fine
- lll
# - loggercheck # not using these logs
Expand All @@ -86,20 +89,25 @@ linters:
# - nosnakecase [deprecated]
- nosprintfhostport
# - paralleltest # not making every test parallel
- perfsprint
- prealloc
- predeclared
# - promlinter # not using prometheus
- protogetter
- reassign
- revive
- rowserrcheck
# - scopelint [deprecated]
- sloglint
- spancheck
- sqlclosecheck
# - structcheck [deprecated]
- stylecheck
- tagalign
- tagliatelle
- tenv
# - testableexamples # no output comments are ok
- testifylint
# - testpackage # _test packages are not preferred
# - thelper # no need to clean up call stack for tests
- tparallel
Expand Down Expand Up @@ -183,3 +191,15 @@ issues:
path: '(.+)_test\.go'
linters:
- forbidigo
# Does not apply for go 1.22
- text: "G601: Implicit memory aliasing in for loop."
linters:
- gosec
# context is not needed, should be used in the wrapper function
- source: 'jhttp\.ReturnModelOr500\(func\(\) \(any, error\)'
linters:
- contextcheck
# context is not needed, should be used in the wrapper function
- source: 'rs\.runOr500\(r, func\(r \*http\.Request, tx db\.TxQs\) error'
linters:
- contextcheck
4 changes: 2 additions & 2 deletions db/pkg/db/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bufio"
"context"
"encoding/json"
"fmt"
"errors"
"io/fs"
"strings"
"time"
Expand Down Expand Up @@ -265,7 +265,7 @@ func (t TextTokenizer) TokenizedTexts(ctx context.Context, s, translation string
// TokenizeTexts takes the texts and tokenizes them
func (t TextTokenizer) TokenizeTexts(ctx context.Context, texts []text.Text) ([]TokenizedText, error) {
if !t.Tokenizer.IsSetup() {
return nil, fmt.Errorf("TextTokenizer not set up")
return nil, errors.New("TextTokenizer not set up")
}

tokenizedTexts := make([]TokenizedText, len(texts))
Expand Down
6 changes: 2 additions & 4 deletions db/pkg/db/source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func TestSourcePartMedia_MarshalJSON(t *testing.T) {
{name: "prepare_serialize", prepareSerialize: true},
}
for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
txQs := TxQsT(t, nil)

Expand All @@ -66,14 +65,14 @@ func setupParts(t *testing.T, part SourcePart, prePartListID string) []SourcePar

parts := make([]SourcePart, 3)
baseKey := storage.BaseKey(SourcesTable, PartsColumn, prePartListID)
for i := 0; i < len(parts); i++ {
for i := range len(parts) {
parts[i] = part

key := baseKey + ".PreParts[" + strconv.Itoa(i) + "].Image.txt"
parts[i].Media = &SourcePartMedia{ImageKey: key}
require.NoError(storageAPI.Store(key, bytes.NewReader([]byte("image"+strconv.Itoa(i)))))
}
for i := 0; i < 1; i++ {
for i := range 1 {
key := baseKey + ".PreParts[0].Audio.txt"
parts[i].Media.AudioKey = key
require.NoError(storageAPI.Store(key, bytes.NewReader([]byte("audio"+strconv.Itoa(i)+"!"))))
Expand Down Expand Up @@ -172,7 +171,6 @@ func TestTextTokenizer_TokenizedTexts(t *testing.T) {
{name: "translator_none"},
}
for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
require := require.New(t)
t.Parallel()
Expand Down
1 change: 0 additions & 1 deletion db/pkg/db/term_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ func TestTerm_DictionaryTerm(t *testing.T) {
{name: "EmptyVariants", emptyFields: []string{"Variants"}},
}
for _, tc := range tcs {
tc := tc
t.Run(tc.name, func(t *testing.T) {
require := require.New(t)

Expand Down
1 change: 0 additions & 1 deletion db/pkg/db/testdb/models_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func TestSeedList(t *testing.T) {
{name: "mixed", list: map[string]bool{"Notes": true, "Persons": true, "Books": false, "Cups": false}},
}
for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
require := require.New(t)

Expand Down
10 changes: 5 additions & 5 deletions db/pkg/seedkrdict/seed.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (l *LexicalEntry) textVariants() (string, []string, error) {

var err error
if text == "" {
err = fmt.Errorf("LexicalEntry.writtenForm not found")
err = errors.New("LexicalEntry.writtenForm not found")
}
return text, variants, err
}
Expand Down Expand Up @@ -295,7 +295,7 @@ func (s *Sense) translation() (dictionary.Translation, error) {
}
return translation, nil
}
return dictionary.Translation{}, fmt.Errorf("not found")
return dictionary.Translation{}, errors.New("not found")
}

// Equivalent represents the translation of the entry given a special language
Expand All @@ -318,7 +318,7 @@ func (e *Equivalent) translation() (dictionary.Translation, error) {
}
}
if !isEng {
return dictionary.Translation{}, fmt.Errorf("not found")
return dictionary.Translation{}, errors.New("not found")
}

text, explanation := "", ""
Expand All @@ -333,10 +333,10 @@ func (e *Equivalent) translation() (dictionary.Translation, error) {

var err error
if text == "" {
err = fmt.Errorf("text is empty")
err = errors.New("text is empty")
}
if explanation == "" {
err = fmt.Errorf("explanation is empty")
err = errors.New("explanation is empty")
}
for k, v := range cleanTranslationMap {
explanation = strings.ReplaceAll(explanation, k, v)
Expand Down
4 changes: 2 additions & 2 deletions db/pkg/seedkrdict/seed_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package seedkrdict

import (
"fmt"
"errors"
"testing"

"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -74,7 +74,7 @@ func TestIsNoTranslationsFoundError(t *testing.T) {
require := require.New(t)
t.Parallel()
require.True(IsNoTranslationsFoundError(NoTranslationsFoundError{}))
require.False(IsNoTranslationsFoundError(fmt.Errorf("test error")))
require.False(IsNoTranslationsFoundError(errors.New("test error")))
}

func TestLexicalEntry_CreateParams(t *testing.T) {
Expand Down
22 changes: 11 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
module github.com/s12chung/text2anki

go 1.21
go 1.22

require (
github.com/asticode/go-astisub v0.26.2
github.com/ebitengine/purego v0.5.1
github.com/ebitengine/purego v0.7.1
github.com/gabriel-vasile/mimetype v1.4.3
github.com/go-chi/chi/v5 v5.0.11
github.com/go-chi/chi/v5 v5.0.12
github.com/go-chi/cors v1.2.1
github.com/gofrs/uuid v4.4.0+incompatible
github.com/mattn/go-sqlite3 v1.14.19
github.com/google/uuid v1.6.0
github.com/mattn/go-sqlite3 v1.14.22
github.com/pemistahl/lingua-go v1.4.0
github.com/stretchr/testify v1.8.4
gopkg.in/dnaeon/go-vcr.v3 v3.1.2
github.com/stretchr/testify v1.9.0
gopkg.in/dnaeon/go-vcr.v3 v3.2.0
)

require (
Expand All @@ -21,10 +21,10 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
40 changes: 20 additions & 20 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ github.com/asticode/go-astits v1.13.0/go.mod h1:QSHmknZ51pf6KJdHKZHJTLlMegIrhega
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/ebitengine/purego v0.5.1 h1:hNunhThpOf1vzKl49v6YxIsXLhl92vbBEv1/2Ez3ZrY=
github.com/ebitengine/purego v0.5.1/go.mod h1:ah1In8AOtksoNK6yk5z1HTJeUkC1Ez4Wk2idgGslMwQ=
github.com/ebitengine/purego v0.7.1 h1:6/55d26lG3o9VCZX8lping+bZcmShseiqlh2bnUDiPA=
github.com/ebitengine/purego v0.7.1/go.mod h1:ah1In8AOtksoNK6yk5z1HTJeUkC1Ez4Wk2idgGslMwQ=
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
github.com/go-chi/chi/v5 v5.0.11 h1:BnpYbFZ3T3S1WMpD79r7R5ThWX40TaFB7L31Y8xqSwA=
github.com/go-chi/chi/v5 v5.0.11/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/chi/v5 v5.0.12 h1:9euLV5sTrTNTRUU9POmDUvfxyj6LAABLUcEWO+JJb4s=
github.com/go-chi/chi/v5 v5.0.12/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4=
github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58=
github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA=
github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/mattn/go-sqlite3 v1.14.19 h1:fhGleo2h1p8tVChob4I9HpmVFIAkKGpiukdrgQbWfGI=
github.com/mattn/go-sqlite3 v1.14.19/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/pemistahl/lingua-go v1.4.0 h1:ifYhthrlW7iO4icdubwlduYnmwU37V1sbNrwhKBR4rM=
github.com/pemistahl/lingua-go v1.4.0/go.mod h1:ECuM1Hp/3hvyh7k8aWSqNCPlTxLemFZsRjocUf3KgME=
github.com/pkg/profile v1.4.0/go.mod h1:NWz/XGvpEW1FyYQ7fCx4dqYBLlfTcE+A9FLAkNKqjFE=
Expand All @@ -33,32 +33,32 @@ github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5g
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 h1:hNQpMuAJe5CtcUqCXaWga3FHu+kQvCqcsoVaQgSV60o=
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08=
golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8=
golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/dnaeon/go-vcr.v3 v3.1.2 h1:F1smfXBqQqwpVifDfUBQG6zzaGjzT+EnVZakrOdr5wA=
gopkg.in/dnaeon/go-vcr.v3 v3.1.2/go.mod h1:2IMOnnlx9I6u9x+YBsM3tAMx6AlOxnJ0pWxQAzZ79Ag=
gopkg.in/dnaeon/go-vcr.v3 v3.2.0 h1:Rltp0Vf+Aq0u4rQXgmXgtgoRDStTnFN83cWgSGSoRzM=
gopkg.in/dnaeon/go-vcr.v3 v3.2.0/go.mod h1:2IMOnnlx9I6u9x+YBsM3tAMx6AlOxnJ0pWxQAzZ79Ag=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
5 changes: 3 additions & 2 deletions integrations/tokenizers/khaiii/pkg/khaiii/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ typedef struct khaiii_word_t_ {
import "C"

import (
"errors"
"fmt"
"unsafe"
)
Expand Down Expand Up @@ -70,7 +71,7 @@ func (k *Khaiii) Version() string {
// Open opens the training resource directory
func (k *Khaiii) Open(rscDir string) error {
if k.openHandle != 0 {
return fmt.Errorf("Khaiii.Open() is already open")
return errors.New("Khaiii.Open() is already open")
}
openHandle := open(rscDir, "{}")
if openHandle == -1 {
Expand All @@ -83,7 +84,7 @@ func (k *Khaiii) Open(rscDir string) error {
// Analyze analyzes the input string
func (k *Khaiii) Analyze(input string) ([]Word, error) {
if k.openHandle <= 0 {
return nil, fmt.Errorf("Khaiii.Open() invalid for Analyze()")
return nil, errors.New("Khaiii.Open() invalid for Analyze()")
}

var err error
Expand Down
1 change: 0 additions & 1 deletion pkg/anki/anki_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ func TestNote_UsageSoundFilename(t *testing.T) {
}

for _, tc := range tcs {
tc := tc
t.Run(tc.usage, func(t *testing.T) {
require := require.New(t)
note := Note{Usage: tc.usage}
Expand Down
1 change: 0 additions & 1 deletion pkg/api/notes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ func TestRoutes_NoteCreate(t *testing.T) {
{name: "invalid", expectedCode: http.StatusUnprocessableEntity},
}
for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
require := require.New(t)
txQs := testdb.TxQs(t, db.WriteOpts())
Expand Down
4 changes: 0 additions & 4 deletions pkg/api/parts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ func TestRoutes_PartCreateMulti(t *testing.T) {
{name: "51_parts", expectedCode: http.StatusUnprocessableEntity},
}
for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
txQs := testdb.TxQs(t, db.WriteOpts())
Expand All @@ -69,7 +68,6 @@ func TestRoutes_PartCreate(t *testing.T) {
{name: "empty", expectedCode: http.StatusUnprocessableEntity},
}
for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
txQs := testdb.TxQs(t, db.WriteOpts())
Expand Down Expand Up @@ -99,7 +97,6 @@ func TestRoutes_PartUpdate(t *testing.T) {
{name: "empty", index: 1, expectedCode: http.StatusUnprocessableEntity},
}
for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
txQs := testdb.TxQs(t, db.WriteOpts())
Expand Down Expand Up @@ -129,7 +126,6 @@ func TestRoutes_PartDestroy(t *testing.T) {
{name: "index_negative", index: -1, expectedCode: http.StatusUnprocessableEntity},
}
for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
require := require.New(t)
t.Parallel()
Expand Down
Loading
Loading