chore: Add nix shell for simple development setup (#3399)

* chore: Add nix shell for simple development setup

This enables contributors using Nix to set up their environment with ease.

* improve nix style, flake output schema

* fix error message

* Update scripts/build_go_slim.sh

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>

* Update scripts/build_go_slim.sh

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>

* Add UTC default for timezone and remove unnecessary goreleaser dependency

* Skip TZ test if localtime does not exist

Co-authored-by: Charlie Moog <moogcharlie@gmail.com>
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
This commit is contained in:
Kyle Carberry
2022-08-08 10:49:12 -05:00
committed by GitHub
parent 3279504cbe
commit 9c12b4ed8e
9 changed files with 175 additions and 9 deletions

View File

@ -16,11 +16,11 @@ var errInvalidTimeFormat = xerrors.New("Start time must be in the format hh:mm[a
var errUnsupportedTimezone = xerrors.New("The location you provided looks like a timezone. Check https://ipinfo.io for your location.")
// durationDisplay formats a duration for easier display:
// * Durations of 24 hours or greater are displays as Xd
// * Durations less than 1 minute are displayed as <1m
// * Duration is truncated to the nearest minute
// * Empty minutes and seconds are truncated
// * The returned string is the absolute value. Use sign()
// - Durations of 24 hours or greater are displays as Xd
// - Durations less than 1 minute are displayed as <1m
// - Duration is truncated to the nearest minute
// - Empty minutes and seconds are truncated
// - The returned string is the absolute value. Use sign()
// if you need to indicate if the duration is positive or
// negative.
func durationDisplay(d time.Duration) string {
@ -114,7 +114,7 @@ func parseCLISchedule(parts ...string) (*schedule.Schedule, error) {
if loc == nil {
loc, err = tz.TimezoneIANA()
if err != nil {
return nil, xerrors.Errorf("Could not automatically determine your timezone")
loc = time.UTC
}
}