~poldi1405/go-indicators

a3b385e454065a1afcfe817cd60d2cc501f2fb24 — Moritz Poldrack 5 months ago 2b6fb24 master v1.1.1
added int to available types
1 files changed, 4 insertions(+), 0 deletions(-)

M progress/calculate.go
M progress/calculate.go => progress/calculate.go +4 -0
@@ 10,6 10,8 @@ func GetPercentage(parts, total interface{}) (float64, error) {
	var fparts, ftotal float64

	switch parts.(type) { // {{{ type switch for parts
	case int:
		fparts = float64(parts.(int))
	case uint8:
		fparts = float64(parts.(uint8))
	case int8:


@@ 35,6 37,8 @@ func GetPercentage(parts, total interface{}) (float64, error) {
	} // }}}

	switch total.(type) { // {{{ type switch for total
	case int:
		ftotal = float64(total.(int))
	case uint8:
		ftotal = float64(total.(uint8))
	case int8: