-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from jmattheis/struct-pointer
Struct pointer
- Loading branch information
Showing
25 changed files
with
441 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
input: | ||
input.go: | | ||
package structs | ||
// goverter:converter | ||
type Converter interface { | ||
// goverter:map . FullName | ToFullName | ||
ConvertPerson(source *Person) *APIPerson | ||
} | ||
type Person struct { | ||
FirstName string | ||
LastName string | ||
} | ||
type APIPerson struct { | ||
FullName string | ||
} | ||
func ToFullName(input *Person) string { | ||
return input.FirstName + " " + input.LastName | ||
} | ||
success: | | ||
// Code generated by github.com/jmattheis/goverter, DO NOT EDIT. | ||
package generated | ||
import execution "github.com/jmattheis/goverter/execution" | ||
type ConverterImpl struct{} | ||
func (c *ConverterImpl) ConvertPerson(source *execution.Person) *execution.APIPerson { | ||
var pStructsAPIPerson *execution.APIPerson | ||
if source != nil { | ||
var structsAPIPerson execution.APIPerson | ||
structsAPIPerson.FullName = execution.ToFullName(source) | ||
pStructsAPIPerson = &structsAPIPerson | ||
} | ||
return pStructsAPIPerson | ||
} |
Oops, something went wrong.