Create a gist now

Instantly share code, notes, and snippets.

@lnds /for.go
Created Jan 11, 2016

For y range en Go
num := make([]int, 0, tam)
for i, c := range accion {
if !unicode.IsDigit(c) {
return nil
} else if i >= tam {
return nil
} else {
digit := int (c - '0')
for _, d := range num {
if digit == d { return nil }
}
num = num[0:i+1]
num[i] = digit
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment