Skip to content

Conversation

@yoki123
Copy link

@yoki123 yoki123 commented Jan 1, 2020

Add a random number for the column's name while column's name is duplicated

columns[i] = postgresify(col)
name := postgresify(col)
if inArray(columns[0:i], name) {
name += fmt.Sprintf("_%d", rand.Intn(10000))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name += fmt.Sprintf("_%d", rand.Intn(10000))
name += fmt.Sprintf("_%d", i)

"errors"
"fmt"
"io"
"math/rand"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"math/rand"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants