Skip to content

Instantly share code, notes, and snippets.

@austin-millan
Created June 12, 2021 23:11
Show Gist options
  • Save austin-millan/f680bda56c1875a1351c4041e3a82604 to your computer and use it in GitHub Desktop.
Save austin-millan/f680bda56c1875a1351c4041e3a82604 to your computer and use it in GitHub Desktop.
Markdium-
package main
import (
"encoding/json"
"fmt"
)
type A struct {
ValA int `json:"valA"`
ValB int `json:"valB"`
}
var input = A{}
func main() {
json.Unmarshal([]byte(`{"valA": 1, "valB": 1}`), &input)
json.Unmarshal([]byte(`{"valA": 0}`), &input)
output, _ := json.Marshal(input)
fmt.Println(string(output))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment