mirror of https://github.com/rwxrob/dot
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
448 B
Plaintext
21 lines
448 B
Plaintext
3 years ago
|
#!/usr/bin/env bash
|
||
|
|
||
|
read -r name
|
||
|
|
||
|
echo "
|
||
|
func (s $name) MarshalJSON() ([]byte, error) {
|
||
|
buf := ""
|
||
|
// TODO
|
||
|
return []byte(buf),nil
|
||
|
}
|
||
|
|
||
|
// JSON implements PrintAsJSON multi-line, 2-space indent JSON output.
|
||
|
func (s $name) JSON() string {b,_ :=s.MarshalJSON();return string(b)}
|
||
|
|
||
|
// Print implements PrintAsJSON.
|
||
|
func (s $name) Print() { fmt.Println(s.JSON()) }
|
||
|
|
||
|
// Log implements PrintAsJSON.
|
||
|
func (s $name) Log() { log.Print(s.JSON()) }
|
||
|
"
|