Skip to content

Commit 07edfcf

Browse files
authored
fix(reader): remove unused context and return nil error (#96)
Remove the unused context parameter in envReader.Read by replacing ctx with a blank identifier. Change the returned error from ctx.Err() to nil since the context is not used for cancellation or timeout. This simplifies the method and clarifies that no error is expected from context handling.
1 parent 0be2130 commit 07edfcf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

reader.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ func (r *envReader) Prefix() string {
1616
return r.prefix
1717
}
1818

19-
func (r *envReader) Read(ctx context.Context) (any, error) {
19+
func (r *envReader) Read(_ context.Context) (any, error) {
2020
res := map[string]string{}
2121
for env, key := range r.mapEnvKey {
2222
if value, ok := os.LookupEnv(env); ok {
2323
res[key] = value
2424
}
2525
}
2626

27-
return res, ctx.Err()
27+
return res, nil
2828
}
2929

3030
// New creates the Env reader

0 commit comments

Comments
 (0)