Ver código fonte

refactor(date): use an else-if instead of two if statements

Julien Voisin 1 ano atrás
pai
commit
7eb1d15315
1 arquivos alterados com 1 adições e 3 exclusões
  1. 1 3
      internal/reader/date/parser.go

+ 1 - 3
internal/reader/date/parser.go

@@ -354,9 +354,7 @@ func parseLocalTimeDates(layout, ds string) (t time.Time, err error) {
 	// Workaround for dates that don't use GMT.
 	// Workaround for dates that don't use GMT.
 	if strings.HasSuffix(ds, "PST") || strings.HasSuffix(ds, "PDT") {
 	if strings.HasSuffix(ds, "PST") || strings.HasSuffix(ds, "PDT") {
 		loc, _ = time.LoadLocation("America/Los_Angeles")
 		loc, _ = time.LoadLocation("America/Los_Angeles")
-	}
-
-	if strings.HasSuffix(ds, "EST") || strings.HasSuffix(ds, "EDT") {
+	} else if strings.HasSuffix(ds, "EST") || strings.HasSuffix(ds, "EDT") {
 		loc, _ = time.LoadLocation("America/New_York")
 		loc, _ = time.LoadLocation("America/New_York")
 	}
 	}