copyslice

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompanySliceCopy

func CompanySliceCopy(dst *CompanyDest, src *Company)

func DiffTypeSliceCopy

func DiffTypeSliceCopy(dst *DestCompany, src *SourceCompany)

func SliceCopy

func SliceCopy(dst *SliceDestination, src *SliceSource)

Types

type Address

type Address struct {
	Street  string
	City    string
	Country string
}

Address represents a nested structure

type Company

type Company struct {
	CompanyName string
	Departments []Department
	HeadOffice  string
}

Company represents the source structure with department slice

type CompanyDest

type CompanyDest struct {
	CompanyName string
	Departments []Department
	HeadOffice  string
}

CompanyDest represents the destination structure

type ContactInfo

type ContactInfo struct {
	Email     string
	Phone     string
	Emergency bool
}

ContactInfo represents another nested structure

type Department

type Department struct {
	Name      string
	Location  string
	Employees []Person
}

Department represents a department with employees

type DestCompany

type DestCompany struct {
	CompanyName string
	Departments []DestDepartment
	HeadOffice  string
	YearFounded int
}

DestCompany represents the destination company structure

type DestDepartment

type DestDepartment struct {
	DeptName  string
	Location  string
	Employees []DestPerson
	Budget    int
	HeadCount int
}

DestDepartment represents a department in destination

type DestPerson

type DestPerson struct {
	Name       string
	Age        int
	Department string
	Skills     []string
}

DestPerson represents a person in destination structure

type Person

type Person struct {
	Name string
	Age  int
}

Person represents a basic person info

type SliceDestination

type SliceDestination struct {
	Numbers   []int
	Names     []string
	Addresses []Address
	Matrix    [][]int
	Contacts  []ContactInfo
}

SliceDestination mirrors the source structure

type SliceSource

type SliceSource struct {
	Numbers   []int         // Simple slice type
	Names     []string      // Simple slice type
	Addresses []Address     // Complex slice type
	Matrix    [][]int       // Nested slice type
	Contacts  []ContactInfo // Another complex slice type
}

SliceSource contains various types of slices

type SourceCompany

type SourceCompany struct {
	CompanyName string
	Departments []SourceDepartment
	HeadOffice  string
	YearFounded int
}

SourceCompany represents the source company structure

type SourceDepartment

type SourceDepartment struct {
	DeptName  string
	Location  string
	Employees []SourcePerson
	Budget    int
	HeadCount int
}

SourceDepartment represents a department in source

type SourcePerson

type SourcePerson struct {
	Name       string
	Age        int
	Department string
	Skills     []string
}

SourcePerson represents a person in source structure

Jump to

Keyboard shortcuts

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