ch3.5
This commit is contained in:
15
internal/data/runtime.go
Normal file
15
internal/data/runtime.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type Runtime int32
|
||||
|
||||
func (r Runtime) MarshalJSON() ([]byte, error) {
|
||||
jsonValue := fmt.Sprintf("%d mins", r)
|
||||
|
||||
quotedJSONValue := strconv.Quote(jsonValue)
|
||||
return []byte(quotedJSONValue), nil
|
||||
}
|
||||
Reference in New Issue
Block a user