Skip to content

lyf-coder/utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

utils

go common utils

Actions GoDoc Go Report Card

Install

go get github.com/lyf-coder/utils

Usage

import (
    "github.com/lyf-coder/utils"
)
type People struct {
	Name string
	Age  int
}

type Student struct {
	Name  string
	Grade int
}

s := Student{}
s.Name = "jack"
s.Grade = 100
p := People{}
CopyStruct(s, &p) // s is src struct, p is target struct
p.Name == s.Name == "jack" // p.Name will be same as s.Name is jack