reportName returns a filesystem-safe, timestamped report name. Format: report_ [_ ]_YYYYMMDD_hhmmss
(kind string, timestamp time.Time, objName ...string)
| 39 | // reportName returns a filesystem-safe, timestamped report name. |
| 40 | // Format: report_<kind>[_<object>]_YYYYMMDD_hhmmss |
| 41 | func reportName(kind string, timestamp time.Time, objName ...string) string { |
| 42 | var builder strings.Builder |
| 43 | builder.WriteString("report_") |
| 44 | builder.WriteString(kind) |
| 45 | |
| 46 | if len(objName) != 0 { |
| 47 | builder.WriteString("_") |
| 48 | builder.WriteString(objName[0]) |
| 49 | } |
| 50 | |
| 51 | builder.WriteString("_") |
| 52 | builder.WriteString(timestamp.Format(sortableTimestampFormat)) |
| 53 | |
| 54 | return builder.String() |
| 55 | } |
| 56 | |
| 57 | // zipFileWriter abstracts any function that will write a new file into a ZIP |
| 58 | // within the `dirname` folder in the ZIP |
no test coverage detected