-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathcopygen.go
More file actions
28 lines (22 loc) · 740 Bytes
/
copygen.go
File metadata and controls
28 lines (22 loc) · 740 Bytes
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
// Code generated by github.com/switchupcb/copygen
// DO NOT EDIT.
// Package copygen contains the setup information for copygen generated code.
package copygen
import (
c "strconv"
"github.com/switchupcb/copygen/examples/error/domain"
"github.com/switchupcb/copygen/examples/error/models"
)
/* Define the function and field this converter is applied to using regex. */
// Itoa converts an integer to an ascii value.
func Itoa(i int) string {
return c.Itoa(i)
}
// ModelsToDomain copies a *models.Account, *models.User to a *domain.Account.
func ModelsToDomain(tA *domain.Account, fA *models.Account, fU *models.User) error {
// *domain.Account fields
tA.ID = fA.ID
tA.UserID = Itoa(fU.UserID)
tA.Name = fA.Name
return nil
}