Skip to content

Instantly share code, notes, and snippets.

@mlh758
Created December 21, 2018 19:01
Show Gist options
  • Save mlh758/27f26c7154bd76c69f025e9305cea816 to your computer and use it in GitHub Desktop.
Save mlh758/27f26c7154bd76c69f025e9305cea816 to your computer and use it in GitHub Desktop.
Minimum Test Case
package main
import (
"encoding/json"
"log"
)
const j = `{
"expectation": "Verbalizes understanding",
"description": "Home Medication Administration Plan",
"duration": null,
"duration_unit": null,
"offset_qty": "0.0",
"offset_unit": null,
"concept_cki": null
}`
type outcome struct {
Duration int
DurationUnit string `json:"duration_unit"`
Description string `json:"description"`
Expectation string
OffsetQty string `json:"offset_qty"`
OffsetUnit string `json:"offset_unit"`
}
func main() {
var o outcome
json.Unmarshal([]byte(j), &o)
log.Print(o)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment