Приведение к типам и разделение

This commit is contained in:
Anatoly Prohacky
2022-08-12 21:45:06 +10:00
parent c0acd14e52
commit 20c8a73421
3 changed files with 101 additions and 49 deletions

25
atr/atrib.go Normal file
View File

@@ -0,0 +1,25 @@
package atr
type Atr string
// New Atr
func New(a string) Atr {
return Atr(a)
}
//Glue slice Atr to Atr
func Glue(atr []Atr) Atr {
var endatr Atr
lenatr := len(atr)
for _, a0 := range atr {
if a0 != "" {
endatr = endatr + a0
if lenatr > 1 {
endatr = endatr + ","
}
}
lenatr--
}
return endatr
}