(ctx context.Context, Fremote fs.Fs)
| 3018 | } |
| 3019 | |
| 3020 | func DstLsf(ctx context.Context, Fremote fs.Fs) *bytes.Buffer { |
| 3021 | opt := operations.ListJSONOpt{ |
| 3022 | NoModTime: false, |
| 3023 | NoMimeType: true, |
| 3024 | DirsOnly: false, |
| 3025 | FilesOnly: true, |
| 3026 | Recurse: true, |
| 3027 | ShowHash: true, |
| 3028 | HashTypes: []string{"MD5"}, |
| 3029 | } |
| 3030 | |
| 3031 | var list operations.ListFormat |
| 3032 | |
| 3033 | list.SetSeparator(";") |
| 3034 | timeFormat := operations.FormatForLSFPrecision(Fremote.Precision()) |
| 3035 | if Fremote.Precision() == fs.ModTimeNotSupported { |
| 3036 | timeFormat = "none" |
| 3037 | } |
| 3038 | list.AddModTime(timeFormat) |
| 3039 | list.AddHash(hash.MD5) |
| 3040 | list.AddSize() |
| 3041 | list.AddPath() |
| 3042 | |
| 3043 | out := new(bytes.Buffer) |
| 3044 | |
| 3045 | err := operations.ListJSON(ctx, Fremote, "", &opt, func(item *operations.ListJSONItem) error { |
| 3046 | _, _ = fmt.Fprintln(out, list.Format(item)) |
| 3047 | return nil |
| 3048 | }) |
| 3049 | if err != nil { |
| 3050 | fs.Errorf(Fremote, "ListJSON error: %v", err) |
| 3051 | } |
| 3052 | |
| 3053 | return out |
| 3054 | } |
| 3055 | |
| 3056 | func LoggerMatchesLsf(logger, lsf *bytes.Buffer) error { |
| 3057 | loggerSplit := bytes.Split(logger.Bytes(), []byte("\n")) |
no test coverage detected
searching dependent graphs…