https://github.com/gokits/gotools
tools for golang
https://github.com/gokits/gotools
Last synced: 12 days ago
JSON representation
tools for golang
- Host: GitHub
- URL: https://github.com/gokits/gotools
- Owner: gokits
- Created: 2016-09-08T15:39:47.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-12-02T12:27:52.000Z (over 5 years ago)
- Last Synced: 2025-12-16T03:30:33.338Z (3 months ago)
- Language: Go
- Size: 11.7 KB
- Stars: 15
- Watchers: 3
- Forks: 0
- 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}
*/
```