diff --git a/PROFANITY_RULES.yml b/PROFANITY_RULES.yml new file mode 100644 index 0000000..1e6c803 --- /dev/null +++ b/PROFANITY_RULES.yml @@ -0,0 +1,4 @@ +go-sdk: + excludeFiles: [ "*_test.go" ] + importsContain: [ github.com/blend/go-sdk/* ] + description: "please don't use go-sdk in this repo" \ No newline at end of file diff --git a/times.go b/times.go index 1a21f48..95e2acd 100644 --- a/times.go +++ b/times.go @@ -3,8 +3,6 @@ package chart import ( "sort" "time" - - "github.com/blend/go-sdk/timeutil" ) // Assert types implement interfaces. @@ -29,7 +27,7 @@ func (t Times) Len() int { // GetValue returns a value at an index as a time. func (t Times) GetValue(index int) float64 { - return timeutil.ToFloat64(t[index]) + return ToFloat64(t[index]) } // Swap implements sort.Interface. @@ -41,3 +39,8 @@ func (t Times) Swap(i, j int) { func (t Times) Less(i, j int) bool { return t[i].Before(t[j]) } + +// ToFloat64 returns a float64 representation of a time. +func ToFloat64(t time.Time) float64 { + return float64(t.UnixNano()) +}