Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gokits/gotools
tools for golang
https://github.com/gokits/gotools
Last synced: about 1 month ago
JSON representation
tools for golang
- Host: GitHub
- URL: https://github.com/gokits/gotools
- Owner: gokits
- Created: 2016-09-08T15:39:47.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-12-02T12:27:52.000Z (about 4 years ago)
- Last Synced: 2024-08-03T09:07:07.373Z (4 months ago)
- Language: Go
- Size: 11.7 KB
- Stars: 15
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-github-star - gotools
README
# gotools
tools for golang## StructCopy
Copy fields which have same name and types between different types of struct. Note that unexported fields are ignored.```go
type Src struct {
A int
B string
c byte
}type Dst struct {
A int
B byte
c byte
}func main(){
src := &Src{3, "hello", '2'}
var dst Dst
gotools.StructCopy(&dst, src)
fmt.Println(dst)
}/* output
{3 0 0}
*/
```