Skip to content

Commit 4f1b290

Browse files
Add omitempty to config
1 parent 0a98f41 commit 4f1b290

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

config/config.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import (
1313
type Config struct {
1414
Version string `yaml:"version" validate:"required"`
1515
Database Database `yaml:"database" validate:"required"`
16-
DataSources map[string]DataSource `yaml:"datasources"`
17-
Contracts map[string]Contract `yaml:"contracts"`
18-
Hasura *Hasura `yaml:"hasura" validate:"omitempty"`
19-
Prometheus *Prometheus `yaml:"prometheus" validate:"omitempty"`
16+
DataSources map[string]DataSource `yaml:"datasources,omitempty"`
17+
Contracts map[string]Contract `yaml:"contracts,omitempty"`
18+
Hasura *Hasura `yaml:"hasura,omitempty" validate:"omitempty"`
19+
Prometheus *Prometheus `yaml:"prometheus,omitempty" validate:"omitempty"`
2020
}
2121

2222
// Substitute -
@@ -42,7 +42,7 @@ type Contract struct {
4242

4343
// Database
4444
type Database struct {
45-
Path string `yaml:"path"`
45+
Path string `yaml:"path,omitempty"`
4646
Kind string `yaml:"kind" validate:"required,oneof=sqlite postgres mysql clickhouse elasticsearch"`
4747
Host string `yaml:"host" validate:"required_with=Port User Database"`
4848
Port int `yaml:"port" validate:"required_with=Host User Database,gt=-1,lt=65535"`

0 commit comments

Comments
 (0)