mirror of https://github.com/go-gitea/gitea
Git with a cup of tea, painless self-hosted git service
Mirror for internal git.with.parts use
https://git.with.parts
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
438 B
26 lines
438 B
package garif
|
|
|
|
import (
|
|
"encoding/json"
|
|
"io"
|
|
)
|
|
|
|
// Write writes the JSON
|
|
func (l *LogFile) Write(w io.Writer) error {
|
|
marshal, err := json.Marshal(l)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = w.Write(marshal)
|
|
return err
|
|
}
|
|
|
|
// PrettyWrite writes indented JSON
|
|
func (l *LogFile) PrettyWrite(w io.Writer) error {
|
|
marshal, err := json.MarshalIndent(l, "", " ")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = w.Write(marshal)
|
|
return err
|
|
}
|
|
|