Skip to content

Commit

Permalink
fix: remove obsolete use of tzdata
Browse files Browse the repository at this point in the history
  • Loading branch information
theseion committed Oct 30, 2022
1 parent 9e7a6ac commit 0a1b44b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
6 changes: 3 additions & 3 deletions check/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (c *FTWCheck) SetNoLogContains(contains string) {

// ForcedIgnore check if this id need to be ignored from results
func (c *FTWCheck) ForcedIgnore(id string) bool {
for re, _ := range c.overrides.Ignore {
for re := range c.overrides.Ignore {
if re.MatchString(id) {
return true
}
Expand All @@ -70,7 +70,7 @@ func (c *FTWCheck) ForcedIgnore(id string) bool {

// ForcedPass check if this id need to be ignored from results
func (c *FTWCheck) ForcedPass(id string) bool {
for re, _ := range c.overrides.ForcePass {
for re := range c.overrides.ForcePass {
if re.MatchString(id) {
return true
}
Expand All @@ -80,7 +80,7 @@ func (c *FTWCheck) ForcedPass(id string) bool {

// ForcedFail check if this id need to be ignored from results
func (c *FTWCheck) ForcedFail(id string) bool {
for re, _ := range c.overrides.ForceFail {
for re := range c.overrides.ForceFail {
if re.MatchString(id) {
return true
}
Expand Down
10 changes: 0 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package main
import (
"fmt"
"os"
"time"
_ "time/tzdata"

"github.com/rs/zerolog"
Expand All @@ -29,15 +28,6 @@ func main() {
// Default level for this example is info, unless debug flag is present
zerolog.SetGlobalLevel(zerolog.InfoLevel)

// Load timezone location based on TZ
tzone, _ := time.Now().Zone()
loc, err := time.LoadLocation(tzone)
if err != nil {
log.Info().Msgf("ftw/main: cannot load timezone")
} else {
time.Local = loc // -> set the global timezone
}

cmd.Execute(
buildVersion(version, commit, date, builtBy),
)
Expand Down

0 comments on commit 0a1b44b

Please sign in to comment.