func (s *SeriesData) Sum() (total float64, ok bool) {
	total = 0.0
	for k, v := range *s.Data {
		if reflect.TypeOf(v) == reflect.TypeOf(1) || reflect.TypeOf(v) == reflect.TypeOf(1.1) {
			total += float64(reflect.ValueOf(v).Float())
		} else {
			log.Println(k, " failed")
			return
		}
	}
	ok = true
	return
}
If row is made up of numeric numbers, get total
package utils
import (
	"fmt"
	"log"
	"net/http"
	"os/exec"
	"reflect"
	"strings"
)
func errorSolution(err string) (string, bool) {
	switch {
	default:
		return "", false
	case strings.Contains(err, "no such host"):
		return "Can't contact Google Analytics server, no internet connect?", true
	case strings.Contains(err, "Error unmarshalling config file"):
		return "Bad client_secret JSON file, try generating a new one", true
	}
}
func CheckError(err error) {
	if err != nil {
		log.Fatalln(err.Error())
	}
}
func BrowserOpen(url string) error {
	return exec.Command("open", url).Run()
}
func WebCallback(ch chan string) {
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		if strings.Contains(r.RequestURI, "/?") {
			block := strings.SplitAfter(r.RequestURI, "/?")[1]
			if !strings.Contains(block, "code=") {
				ch <- block
			} else {
				ch <- strings.SplitAfter(block, "code=")[1]
				fmt.Fprintln(w, "Authentication completed, you can close this window.")
				close(ch)
				return
			}
		}
		fmt.Fprintln(w, "Error encountered during authentication.")
		return
	})
	log.Fatalf("Server exited: %v", http.ListenAndServe(ReturnURI, nil))
}
type DiffMap [][]int
type SeriesData struct {
	Data    *[]interface{}
	Headers *[]string
	Size    int
}
func Series(data *map[string]interface{}) *SeriesData {
	output := new(SeriesData)
	i := 0
	keys := make([]string, len(*data))
	values := make([]interface{}, len(*data))
	for k, v := range *data {
		keys[i] = k
		values[i] = v
		i++
	}
	output.Data = &values
	output.Headers = &keys
	output.Size = len(keys)
	return output
}
func (s *SeriesData) Get(key string) (loc int, val interface{}, ok bool) {
	for i, a := range *s.Headers {
		if a == key {
			val = (*s.Data)[i]
			ok = true
			loc = i
			return
		}
	}
	return
}
func (s *SeriesData) Add(key string, val interface{}) (ok bool) {
	if _, _, has := s.Get(key); !has {
		*s.Headers = append(*s.Headers, key)
		*s.Data = append(*s.Data, val)
		ok = true
		s.Size += 1
	}
	return
}
func (s *SeriesData) Delete(key string) (ok bool) {
	if loc, _, has := s.Get(key); has {
		*s.Headers = append((*s.Headers)[:loc], (*s.Headers)[loc+1:]...)
		*s.Data = append((*s.Data)[:loc], (*s.Data)[loc+1:]...)
		ok = true
		s.Size -= 1
	}
	return
}