More "go vet" fixes.
Turns out annotations on struct fields must be of the form:
`key:"value"`
When the value was not placed in quotes, the "json" annotation was being
ignored.
The fix:
- For the principal tool, I just set the quotes and "backward"
compatibility with the previous field names is a concern that I'm
disregarding
- For identityd/sql.go - I'm just removing the annotations that
were being ignored anyway. Side note: JSON unmarshaling seems to
be insenstive to the casing of the key string.
Change-Id: I7ccc38e5eebf4a41eefe042f0e184bec47aef03d
diff --git a/cmd/principal/main.go b/cmd/principal/main.go
index dc95990..834a0ed 100644
--- a/cmd/principal/main.go
+++ b/cmd/principal/main.go
@@ -859,9 +859,9 @@
}
type recvBlessingsInfo struct {
- RemoteKey string `json:remote_key`
- RemoteToken string `json:remote_token`
- Name string `json:name`
+ RemoteKey string `json:"remote_key"`
+ RemoteToken string `json:"remote_token"`
+ Name string `json:"name"`
}
func writeRecvBlessingsInfo(fname string, remoteKey, remoteToken, name string) error {
diff --git a/services/identity/identityd/sql.go b/services/identity/identityd/sql.go
index b01e47a..fc5c127 100644
--- a/services/identity/identityd/sql.go
+++ b/services/identity/identityd/sql.go
@@ -33,15 +33,15 @@
// needed to encrypt the information sent over the wire.
type sqlConfig struct {
// DataSourceName is the connection string required by go-sql-driver: "[username[:password]@][protocol[(address)]]/dbname".
- DataSourceName string `json:dataSourceName`
+ DataSourceName string
// RootCertPath is the root certificate of the sql server for ssl.
- RootCertPath string `json:rootCertPath`
+ RootCertPath string
// TLSServerName is the domain name of the sql server for ssl.
- TLSServerName string `json:tlsServerName`
+ TLSServerName string
// ClientCertPath is the client certificate for ssl.
- ClientCertPath string `json:clientCertPath`
+ ClientCertPath string
// ClientKeyPath is the client private key for ssl.
- ClientKeyPath string `json:clientKeyPath`
+ ClientKeyPath string
}
func dbFromConfigFile(file string) (*sql.DB, error) {