utils

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2020 License: MIT Imports: 1 Imported by: 0

README

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    	

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyStruct

func CopyStruct(src interface{}, target interface{})

CopyStruct - copy val from src struct to target struct target is &

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL