Sfoglia il codice sorgente

db: Omit empty optional fields from JSON

max furman 7 anni fa
parent
commit
46c7592f34
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      db/db.go

+ 2 - 2
db/db.go

@@ -22,8 +22,8 @@ var ErrAlreadyExists = errors.New("already exists")
 type Config struct {
 	Type       string `json:"type"`
 	DataSource string `json:"dataSource"`
-	ValueDir   string `json:"valueDir"`
-	Database   string `json:"database"`
+	ValueDir   string `json:"valueDir,omitempty"`
+	Database   string `json:"database,omitempty"`
 }
 
 // AuthDB is an interface over an Authority DB client that implements a nosql.DB interface.