Skip to content

Commit

Permalink
chore: fixup
Browse files Browse the repository at this point in the history
Signed-off-by: moul <[email protected]>
  • Loading branch information
moul committed Dec 10, 2024
1 parent 9b36a4d commit 5dd4df1
Showing 1 changed file with 0 additions and 129 deletions.
129 changes: 0 additions & 129 deletions examples/gno.land/p/moul/typeutil/typeutil.gno
Original file line number Diff line number Diff line change
Expand Up @@ -259,119 +259,6 @@ func join(slice interface{}) string {
return b.String()
}

// Helper functions for joining slices
func joinStrings(slice []string) string {
if len(slice) == 0 {
return "[]"
}
var b strings.Builder
b.WriteString("[")
for i, s := range slice {
if i > 0 {
b.WriteString(" ")
}
b.WriteString(s)
}
b.WriteString("]")
return b.String()
}

func joinInts(slice []int) string {
if len(slice) == 0 {
return "[]"
}
var b strings.Builder
b.WriteString("[")
for i, num := range slice {
if i > 0 {
b.WriteString(" ")
}
b.WriteString(strconv.Itoa(num))
}
b.WriteString("]")
return b.String()
}

func joinInt32s(slice []int32) string {
if len(slice) == 0 {
return "[]"
}
var b strings.Builder
b.WriteString("[")
for i, num := range slice {
if i > 0 {
b.WriteString(" ")
}
b.WriteString(strconv.FormatInt(int64(num), 10))
}
b.WriteString("]")
return b.String()
}

func joinInt64s(slice []int64) string {
if len(slice) == 0 {
return "[]"
}
var b strings.Builder
b.WriteString("[")
for i, num := range slice {
if i > 0 {
b.WriteString(" ")
}
b.WriteString(strconv.FormatInt(num, 10))
}
b.WriteString("]")
return b.String()
}

func joinFloat32s(slice []float32) string {
if len(slice) == 0 {
return "[]"
}
var b strings.Builder
b.WriteString("[")
for i, num := range slice {
if i > 0 {
b.WriteString(" ")
}
b.WriteString(strconv.FormatFloat(float64(num), 'f', -1, 32))
}
b.WriteString("]")
return b.String()
}

func joinFloat64s(slice []float64) string {
if len(slice) == 0 {
return "[]"
}
var b strings.Builder
b.WriteString("[")
for i, num := range slice {
if i > 0 {
b.WriteString(" ")
}
b.WriteString(strconv.FormatFloat(num, 'f', -1, 64))
}
b.WriteString("]")
return b.String()
}

func joinInterfaces(slice []interface{}) string {
if len(slice) == 0 {
return "[]"
}
var b strings.Builder
b.WriteString("[")
for i, v := range slice {
if i > 0 {
b.WriteString(" ")
}
b.WriteString(ToString(v))
}
b.WriteString("]")
return b.String()
}

func joinTimes(slice []time.Time) string {
if len(slice) == 0 {
return "[]"
Expand Down Expand Up @@ -420,22 +307,6 @@ func joinBytes(slice [][]byte) string {
return b.String()
}

func joinStringers(slice []stringer) string {
if len(slice) == 0 {
return "[]"
}
var b strings.Builder
b.WriteString("[")
for i, s := range slice {
if i > 0 {
b.WriteString(" ")
}
b.WriteString(s.String())
}
b.WriteString("]")
return b.String()
}

// ToBool converts any value to a boolean based on common programming conventions.
// For example:
// - Numbers: 0 is false, any other number is true
Expand Down

0 comments on commit 5dd4df1

Please sign in to comment.