From 2e809fbc0337ececf3c0c5cef84829cd9ffc49da Mon Sep 17 00:00:00 2001 From: Yukine Date: Thu, 4 Feb 2021 03:51:47 +0100 Subject: [PATCH] fix(main): fix sorting of snapshots --- cmd/DigitalOceanSnapshotter/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/DigitalOceanSnapshotter/main.go b/cmd/DigitalOceanSnapshotter/main.go index dc6d0ae..e3323da 100644 --- a/cmd/DigitalOceanSnapshotter/main.go +++ b/cmd/DigitalOceanSnapshotter/main.go @@ -107,12 +107,12 @@ func main() { if snapshotLength > snapshotCount { sort.SliceStable(snapshots, func(firstIndex, secondIndex int) bool { - firstTime, err := time.Parse(snapshots[firstIndex].Created, createdAtFormat) + firstTime, err := time.Parse(createdAtFormat, snapshots[firstIndex].Created) if err != nil { handleError(ctx, err, true) } - secondTime, err := time.Parse(snapshots[firstIndex].Created, createdAtFormat) + secondTime, err := time.Parse(createdAtFormat, snapshots[firstIndex].Created) if err != nil { handleError(ctx, err, true) }