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

memory alignment #60

Merged
merged 1 commit into from
Nov 15, 2023
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
6 changes: 3 additions & 3 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import (

// Config is a registry which holds configuration loaded by Loader(s).
type Config struct {
decodeHook mapstructure.DecodeHookFunc
delimiter string
tagName string
decodeHook mapstructure.DecodeHookFunc

onChanges *onChanges
values *provider
providers []*provider
onChanges *onChanges
}

type Unmarshaler interface {
Expand Down Expand Up @@ -163,9 +163,9 @@ func (c Config) Watch(ctx context.Context) error { //nolint:cyclop,funlen
}

type provider struct {
values map[string]any
watcher Watcher
watchOnce sync.Once
values map[string]any
}

func (p *provider) sub(path string, delimiter string) any {
Expand Down
2 changes: 0 additions & 2 deletions global.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ func Get[T any](path string) T { //nolint:ireturn
"path", path,
"type", reflect.TypeOf(value),
)

return *new(T)
}

return value
Expand Down
2 changes: 1 addition & 1 deletion provider/fs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (

// FS is a Provider that loads configuration from file system.
type FS struct {
unmarshal func([]byte, any) error
fs fs.FS
path string
unmarshal func([]byte, any) error
ignoreNotExist bool
}

Expand Down
Loading