Skip to content

Instantly share code, notes, and snippets.

@sago35

sago35/main.go Secret

Created May 19, 2023 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sago35/31f13b47b7da4f44d7ddb714b15e8b2c to your computer and use it in GitHub Desktop.
Save sago35/31f13b47b7da4f44d7ddb714b15e8b2c to your computer and use it in GitHub Desktop.
TinyGo 0.28 vs encoding/json
package main
import (
"encoding/json"
"fmt"
)
func main() {
v := TargetJSON{}
json.Unmarshal([]byte(targetJSON), &v)
b, _ := json.Marshal(v)
fmt.Printf("%s\n", string(b))
}
const targetJSON = `
{
"build-tags": ["wioterminal"],
"flash-method": "msd"
}
`
type TargetJSON struct {
BuildTags []string `json:"build-tags"`
FlashMethod string `json:"flash-method"`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment