awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
jinzhu avatar

jinzhu/copier

0
View on GitHub↗
6,172 stars·495 forks·Go·MIT·11 views

Copier

Copier is a Go library that deep copies data between structs, maps, and slices using reflection-based field mapping and struct tag controls. At its core, it automatically transfers values by matching source and destination fields by name, type, and methods, creating fully independent copies of nested data structures to prevent shared references and unintended mutations.

The library distinguishes itself through tag-driven copy rules that give developers fine-grained control over the copying process. Struct tags can enforce mandatory field copying, exclude specific fields from transfer, or map fields with different names between source and destination types. It also supports automatic type coercion between compatible slice and map types, and can skip zero-value fields in the source to prevent overwriting existing destination data with empty values.

Beyond basic struct-to-struct copying, Copier handles copying between slices and maps with the same mapping rules, and can convert a single struct into a slice element. The library provides method-to-field resolution, allowing source methods to populate destination fields, and supports recursive deep copying of arbitrarily nested structures. Documentation and installation are available through the project's repository.

Features

  • Struct-to-Struct Copiers - Copies values between structs by matching fields, methods, and tags for automatic data transfer.
  • Deep Copying Libraries - Provides a deep copying library for creating independent duplicates of nested data structures.
  • Go Struct Copiers - Deep copies values between Go structs, maps, and slices using field matching and struct tags.
  • Reflection-Based Field Matchers - Matches struct fields by name, type, and tags using Go reflection for automatic value transfer.
  • Method-to-Field Resolvers - Provides method-to-field resolution for populating destination fields from source method return values.
  • Copy Rule Controllers - Controls copy behavior with struct tags to enforce, ignore, or rename fields during value transfer.
  • Field Copy Exclusions - Provides struct tags to skip copying specific fields, preventing unwanted data transfer between structs.
  • Copy Behavior Controllers - Uses struct tags to enforce, ignore, or rename fields during value transfer between types.
  • Copy Control Tags - Uses struct tags to enforce, exclude, or rename fields during copy operations for fine-grained data transfer control.
  • Struct-to-Struct Field Matchers - Implements reflection-based field matching between source and destination structs for automatic copying.
  • Struct Tag Mapping Utilities - Controls copy behavior with struct tags to enforce, ignore, or rename fields during value transfer.
  • Deep Copy Utilities - Creates fully independent copies of complex nested data structures to prevent shared references.
  • Reflection-Based Data Mappers - Transfers data between Go types by matching fields, methods, and tags at runtime.
  • Zero-Value Field Skipping - Skips zero-value source fields during copy to avoid overwriting existing destination data with empty values.
  • Enforced Field Copiers - Enforces mandatory field copying with error or panic if the field is not populated.
  • Map-to-Map Copiers - Copies key-value pairs between maps with automatic type conversion for compatible types.
  • Slice-to-Slice Copiers - Copies values between slices using the same field mapping rules as struct-to-struct copying.
  • Slice and Map Copiers - Copies values between slices or maps with automatic type conversion for compatible types.
  • Slice and Map Type Converters - Converts between compatible slice and map types automatically during copy operations.
  • Zero-Value Field Skippers - Filters out zero-value source fields to avoid overwriting destination data with empty values.
  • Type Coercion Utilities - Automatically converts between compatible slice and map types during copy operations.
  • Development Utilities - Copies values between structs.

Star history

Star history chart for jinzhu/copierStar history chart for jinzhu/copier

How this analysis was created: This summary and feature list were written by an AI model that read the project's README and public documentation pages. Each feature links to the documentation it came from; stars, license and language come straight from the GitHub API. The model does not read the source code, and the analysis is refreshed when the project is re-analysed. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Frequently asked questions

What does jinzhu/copier do?

Copier is a Go library that deep copies data between structs, maps, and slices using reflection-based field mapping and struct tag controls. At its core, it automatically transfers values by matching source and destination fields by name, type, and methods, creating fully independent copies of nested data structures to prevent shared references and unintended mutations.

What are the main features of jinzhu/copier?

The main features of jinzhu/copier are: Struct-to-Struct Copiers, Deep Copying Libraries, Go Struct Copiers, Reflection-Based Field Matchers, Method-to-Field Resolvers, Copy Rule Controllers, Field Copy Exclusions, Copy Behavior Controllers.

What are some open-source alternatives to jinzhu/copier?

Open-source alternatives to jinzhu/copier include: fatih/structs — Structs is a reflection utility and type inspection framework for Go. It provides tools for inspecting, converting,… mitchellh/mapstructure — mapstructure is a reflection-based library for the bidirectional encoding and decoding of generic map data into native… kolodny/immutability-helper — immutability-helper is an immutable data manipulation library and object utility used for creating modified copies of… esotericsoftware/kryo — Kryo is a Java binary serialization framework and object cloning library used to convert Java objects into a compact… rmosolgo/graphql-ruby — GraphQL-Ruby is a Ruby library for building GraphQL APIs with a strongly typed schema and a dedicated query execution… go-pay/gopay — GoPay is a Go SDK that aggregates multiple Chinese and international payment gateways behind a single, unified…

Open-source alternatives to Copier

Similar open-source projects, ranked by how many features they share with Copier.
  • fatih/structsfatih avatar

    fatih/structs

    3,926View on GitHub↗

    Structs is a reflection utility and type inspection framework for Go. It provides tools for inspecting, converting, and validating data structures by extracting field names, tags, and values from Go objects. The library specializes in transforming Go structs into generic maps or slices for serialization and data manipulation. It utilizes tag-driven mapping to determine custom keys and exclusion rules during these transformations. The project covers broader capabilities including metadata extraction, type validation to verify if variables are structs or pointers, and initialization verificati

    Gogogolangstructs
    View on GitHub↗3,926
  • mitchellh/mapstructuremitchellh avatar

    mitchellh/mapstructure

    8,033View on GitHub↗

    mapstructure is a reflection-based library for the bidirectional encoding and decoding of generic map data into native typed Go structures. It functions as a tool for transforming loosely typed map values into specific structs and encoding those structs back into maps. The library utilizes Go reflection to map generic data keys to struct fields during runtime. It supports the transformation of untyped data from dynamic sources or configuration files into type-safe native structures. The mapping process includes recursive traversal of nested maps and slices, as well as the use of struct tags

    Go
    View on GitHub↗8,033
  • esotericsoftware/kryoEsotericSoftware avatar

    EsotericSoftware/kryo

    6,529View on GitHub↗

    Kryo is a Java binary serialization framework and object cloning library used to convert Java objects into a compact binary format and restore them from bytes. It provides a system for creating deep or shallow copies of complex object graphs without requiring binary conversion. The project utilizes variable-length integer encoding and integer-ID class registration to reduce the size of serialized data. It handles complex object graphs through circular reference tracking to prevent data duplication and infinite loops. To maintain long-term data viability, it includes schema evolution managemen

    HTML
    View on GitHub↗6,529
  • kolodny/immutability-helperkolodny avatar

    kolodny/immutability-helper

    5,187View on GitHub↗

    immutability-helper is an immutable data manipulation library and object utility used for creating modified copies of objects and arrays. It functions as a command-based state manager and functional data transformer that ensures original source data remains unchanged during updates. The library distinguishes itself by using a declarative set of mutation commands and descriptors to specify changes. It preserves reference equality by returning the original object reference if no actual changes occur during the mutation process. It provides capabilities for deep cloning nested structures and pe

    TypeScript
    View on GitHub↗5,187
  • See all 30 alternatives to Copier→