String implements the stringer interface, formats the Job as it would appear in a well-formed fio config file.
()
| 14 | // String implements the stringer interface, formats the Job |
| 15 | // as it would appear in a well-formed fio config file. |
| 16 | func (job Job) String() string { |
| 17 | ret := []string{fmt.Sprintf("[%s]", job.Name)} |
| 18 | |
| 19 | for k, v := range job.Options { |
| 20 | if v == "" { |
| 21 | ret = append(ret, k) |
| 22 | continue |
| 23 | } |
| 24 | |
| 25 | ret = append(ret, fmt.Sprintf("%s=%s", k, v)) |
| 26 | } |
| 27 | |
| 28 | return strings.Join(ret, "\n") |
| 29 | } |
no outgoing calls