-
Notifications
You must be signed in to change notification settings - Fork 0
/
telephone.go
35 lines (29 loc) · 829 Bytes
/
telephone.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Name: Thomas Nordmann (thomas.nordmann@itslearning.com)
// Date: 13.01.2019
// Function of the package: Userprovisioning for IMS-E
// Function of the file:
package userprovisioning
import (
"strconv"
)
type telefon struct {
Text string `xml:"chardata"`
Teltype string `xml:"teltype,attr"`
}
func Telefon(OneForMobileTwoForOthers int, number string) *telefon {
a := new(telefon)
a.Teltype = strconv.Itoa(OneForMobileTwoForOthers)
a.Text = number
return a
}
func (a *telefon) GetTelefon() (OneForMobileTwoForOthers int, number string) {
tmp, _ := strconv.Atoi(a.Teltype)
return tmp, a.Text
}
func MakeATelefonSlice(oneForMobileTwoForOthers []int, number []string) (res []telefon) {
for i := 0; i < len(number); i++ {
a := Telefon(oneForMobileTwoForOthers[i], number[i])
res = append(res, *a)
}
return
}