momaek / formattag

Align Golang struct tags
35 stars 7 forks source link

Add generics support #3

Closed egorlepa closed 2 years ago

egorlepa commented 2 years ago
./migration/migration.go:285:14: expected '(', found '['
momaek commented 2 years ago

fixed, Please check the latest version

egorlepa commented 2 years ago
go get github.com/momaek/formattag@v0.0.7
for var in $(find . -type f -name "*.go"); do formattag -file $var ; done

still getting erorrs

 expected '(', found '[' (and 1 more errors)
func contains[T string](s []T, e T) bool {
    for i := range s {
        if s[i] == e {
            return true
        }
    }
    return false
}

or maybe i am updating it wrong?

momaek commented 2 years ago

Emmm.. Can you check the binay download from release page ? https://github.com/momaek/formattag/releases/tag/v0.0.7

egorlepa commented 2 years ago

ok it works, thank you also update readme pls: i guess it requires go 1.18 now and command should be

go install github.com/momaek/formattag@v0.0.7

installing executables with 'go get' in module mode is deprecated.

momaek commented 2 years ago

OK. Updated