breite dynamisch anpassen
This commit is contained in:
parent
a3f3e65049
commit
d40e1cab7c
17
dict.go
17
dict.go
@ -56,12 +56,25 @@ func main() {
|
||||
return
|
||||
}
|
||||
|
||||
for i, _ := range left {
|
||||
ml := 5
|
||||
|
||||
for _, v := range right {
|
||||
if len(v) > ml {
|
||||
ml = len(v)
|
||||
}
|
||||
}
|
||||
|
||||
if ml > 40 {
|
||||
ml = 40
|
||||
}
|
||||
|
||||
for i, _ := range right {
|
||||
a := strings.Trim(right[i], `"`)
|
||||
b := strings.Trim(left[i], `"`)
|
||||
if a == "" {
|
||||
continue
|
||||
}
|
||||
fmt.Printf("%25s → %s\n", a, b)
|
||||
// TODO: wrap when len(a) > ml
|
||||
fmt.Printf("%*s → %s\n", ml, a, b)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user