diff options
author | Pavlo Strokov <pstrokov@gitlab.com> | 2021-07-11 18:40:37 +0300 |
---|---|---|
committer | Pavlo Strokov <pstrokov@gitlab.com> | 2021-07-12 15:03:05 +0300 |
commit | a20f8bc864263892d50dd81e9978e4b54d1a5656 (patch) | |
tree | e74d5d827e9474be1a356c10a52a78bcd8f539a7 /internal/cache/diskcache_test.go | |
parent | c8a29dc9fd507cab8835b2e1152b94a6ac96de35 (diff) |
Fix instantiation of the structs with fields assignment
If struct has a list of fields declared the values for
those fields could be assigned during struct instance creation
by providing values in the same order as the fields are declared
or in any order if field names are used to assign the values.
The preferred way is to use a field name assigment as it is less
error prone if you define a new field in the middle of the struct
and as well more readable as you see the list of the initialized
fields.
Diffstat (limited to 'internal/cache/diskcache_test.go')
-rw-r--r-- | internal/cache/diskcache_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/cache/diskcache_test.go b/internal/cache/diskcache_test.go index 78434ced4..10349c658 100644 --- a/internal/cache/diskcache_test.go +++ b/internal/cache/diskcache_test.go @@ -88,7 +88,7 @@ func TestStreamDBNaiveKeyer(t *testing.T) { // enabled feature flags affect caching oldCtx := ctx - ctx = featureflag.IncomingCtxWithFeatureFlag(ctx, featureflag.FeatureFlag{"meow", false}) + ctx = featureflag.IncomingCtxWithFeatureFlag(ctx, featureflag.FeatureFlag{Name: "meow", OnByDefault: false}) expectGetMiss(req1) ctx = oldCtx expectGetHit(expectStream2, req1) |