Documentation
¶
Index ¶
- Variables
- func CheckFatal(t *testing.T, err error)
- func DurationStr(secs int) string
- func FormatDuration(secs int) string
- func LeftPad2Len(s string, padStr string, overallLen int) string
- func Map(vs []string, f func(string) string) []string
- func Percent(val, total int) float64
- func RightPad2Len(s string, padStr string, overallLen int) string
- func StringInSlice(list []string, a string) bool
- func TimeTrack(start time.Time, name string)
- type ByInt64
- type DateRange
- type TestRepo
Constants ¶
This section is empty.
Variables ¶
Now is the func used for system time within gtm This allows for manipulating system time during testing
var TimeTrackEnable = false
Functions ¶
func CheckFatal ¶
CheckFatal raises a fatal error if error is not nil
func DurationStr ¶
DurationStr returns seconds as a duration string, i.e. 9h10m30s
func FormatDuration ¶
FormatDuration converts seconds into a duration string
func LeftPad2Len ¶
LeftPad2Len https://github.com/DaddyOh/golang-samples/blob/master/pad.go
func Map ¶
Map applys a func to a string array
func RightPad2Len ¶
RightPad2Len https://github.com/DaddyOh/golang-samples/blob/master/pad.go
func StringInSlice ¶
StringInSlice https://github.com/DaddyOh/golang-samples/blob/master/pad.go
Types ¶
type DateRange ¶ added in v1.2.4
DateRange creates predefined date ranges and validates if dates are within the range
func AfterNow ¶ added in v1.2.4
AfterNow returns a date range ending n days in the past
func LastMonthRange ¶ added in v1.2.4
func LastMonthRange() DateRange
LastMonthRange returns a date range for last month
func LastWeekRange ¶ added in v1.2.4
func LastWeekRange() DateRange
LastWeekRange returns a date for last week
func LastYearRange ¶ added in v1.2.4
func LastYearRange() DateRange
LastYearRange returns a date range for last year
func ThisMonthRange ¶ added in v1.2.4
func ThisMonthRange() DateRange
ThisMonthRange returns a date range for this month
func ThisWeekRange ¶ added in v1.2.4
func ThisWeekRange() DateRange
ThisWeekRange returns a date range for this week
func ThisYearRange ¶ added in v1.2.4
func ThisYearRange() DateRange
ThisYearRange returns a date range for this year
func TodayRange ¶ added in v1.2.4
func TodayRange() DateRange
TodayRange returns a date range for today
func YesterdayRange ¶ added in v1.2.4
func YesterdayRange() DateRange
YesterdayRange returns a date range for yesterday
func (DateRange) IsSet ¶ added in v1.2.4
IsSet returns true if the date range has a starting and/or ending date
func (DateRange) String ¶ added in v1.2.4
String returns a date range as a string
type TestRepo ¶
type TestRepo struct {
// contains filtered or unexported fields
}
TestRepo represents a test git repo used in testing
func NewTestRepo ¶
NewTestRepo creates a new instance of TestRepo
func (TestRepo) Commit ¶
func (t TestRepo) Commit(treeID *git.Oid) *git.Oid
Commit commits staged files
func (TestRepo) PathIn ¶
PathIn returns full path of file within repo
func (TestRepo) Remove ¶
func (t TestRepo) Remove()
Remove deletes temp directories, files and git repo
func (TestRepo) SaveFile ¶
SaveFile creates a file within the git repo project
Source Files
¶
- date.go
- sort.go
- string.go
- test.go