OLD | NEW |
1 // Copyright 2017 The LUCI Authors. All rights reserved. | 1 // Copyright 2017 The LUCI Authors. All rights reserved. |
2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
4 | 4 |
5 //go:generate stringer -type=Status | 5 //go:generate stringer -type=Status |
6 | 6 |
7 package model | 7 package model |
8 | 8 |
9 import "encoding/json" | 9 import "encoding/json" |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 return true | 54 return true |
55 default: | 55 default: |
56 return false | 56 return false |
57 } | 57 } |
58 } | 58 } |
59 | 59 |
60 // MarshalJSON renders enums into String rather than an int when marshalling. | 60 // MarshalJSON renders enums into String rather than an int when marshalling. |
61 func (s Status) MarshalJSON() ([]byte, error) { | 61 func (s Status) MarshalJSON() ([]byte, error) { |
62 return json.Marshal(s.String()) | 62 return json.Marshal(s.String()) |
63 } | 63 } |
OLD | NEW |