result := []string{} // 整数同士の除算の結果は整数 div := length / num s := 0 e := div for length > 0 { str := fmt.Sprintf("Range: bytes=%d-%d", s, e) s = e + 1 length -= div if length < 0 { e = s + div + length } else { e = s + div } result = append(result, str) } return result }