{"id":38852468,"url":"https://github.com/globusdigital/deep-copy","last_synced_at":"2026-01-17T14:13:50.786Z","repository":{"id":41262608,"uuid":"232328223","full_name":"globusdigital/deep-copy","owner":"globusdigital","description":"Deep copy generator","archived":false,"fork":false,"pushed_at":"2024-05-10T19:09:25.000Z","size":58,"stargazers_count":147,"open_issues_count":9,"forks_count":33,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-06-18T20:16:59.469Z","etag":null,"topics":["code-generator","generator","go","golang"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/globusdigital.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-07T13:16:10.000Z","updated_at":"2024-05-10T19:09:29.000Z","dependencies_parsed_at":"2024-05-12T12:51:47.907Z","dependency_job_id":null,"html_url":"https://github.com/globusdigital/deep-copy","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/globusdigital/deep-copy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globusdigital%2Fdeep-copy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globusdigital%2Fdeep-copy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globusdigital%2Fdeep-copy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globusdigital%2Fdeep-copy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/globusdigital","download_url":"https://codeload.github.com/globusdigital/deep-copy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globusdigital%2Fdeep-copy/sbom","scorecard":{"id":430122,"data":{"date":"2025-08-11","repo":{"name":"github.com/globusdigital/deep-copy","commit":"dc4a8d91ed65656858cd53e6e83bbf7b83d5b7cb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.1,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":6,"reason":"Found 15/22 approved changesets -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":10,"reason":"all dependencies are pinned","details":["Info:   2 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/lint.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 26 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T03:08:27.131Z","repository_id":41262608,"created_at":"2025-08-19T03:08:27.131Z","updated_at":"2025-08-19T03:08:27.131Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28509941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-generator","generator","go","golang"],"created_at":"2026-01-17T14:13:50.726Z","updated_at":"2026-01-17T14:13:50.778Z","avatar_url":"https://github.com/globusdigital.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://github.com/globusdigital/deep-copy/actions?query=workflow%3ACI\"\u003e\n    \u003cimg src=\"https://github.com/globusdigital/deep-copy/workflows/CI/badge.svg\" alt=\"GitHub Actions: CI\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://goreportcard.com/report/github.com/globusdigital/deep-copy\"\u003e\n    \u003cimg src=\"https://goreportcard.com/badge/github.com/globusdigital/deep-copy\" alt=\"GoReportCard\"\u003e\n\u003c/a\u003e\n\n# deep-copy\n\ndeep-copy is a tool for generating DeepCopy() functions for a given type.\n\nGiven a package directory, and a type name that appears in that package, a\n`DeepCopy` method will be generated, to create a deep copy of the type value.\nMembers of the type will also be copied deeply, recursively. If a member `T` of\nthe type has a method `DeepCopy() [*]T`, that method will be reused. Multiple\ntypes can be specified for the given package, by adding more `--type`\nparameters.\n\nTo specify a pointer receiver for the method, an optional `--pointer-receiver`\nboolean flag can be specified. The flag will also govern whether the return\ntype is a pointer as well.\n\nTo specify build tags in the generated code, an optional `--tags` comma separated\nlist flag can be specified. The flag will add all items as build tags to the\ngenerated code.\n\nIt might also be desirable to skip deeply copying certain fields, slice\nmembers, or map members. To achieve that, selectors can be specified in the\noptional comma-separated `--skip` flag. Multiple `--skip` flags can be\nspecified, to match the number of `--type` flags. For example, given the\nfollowing type:\n\n```go\ntype Foo struct {\n     J *int\n     B Bar\n}\n\ntype Bar struct {\n    I *int\n}\n```\n\nLeaving the 'B' field as a shallow copy can be achieved by specifying `--skip\nB`. To skip deeply copying the inner 'I' field, one can specify `--skip B.I`.\nSlice and Map members can also be skipped, by adding `[i]` and `[k]`\nrespectively.\n\nTo specify a max depth of deep copying, use `--maxdepth` option. It stops\ndeep copying at a given depth, with a warning message spotting a place\nthe deep copying has been stopped. It might especially be useful when\none or more structs have circular references.\n\nTo change a method name of deep copying, use `--method` option.\n\n## Usage\n\nPass either path to the folder containing the types or the module name:\n\n```bash\ndeep-copy \u003cflags\u003e /path/to/package/containing/type\ndeep-copy \u003cflags\u003e github.com/globusdigital/deep-copy\ndeep-copy \u003cflags\u003e github.com/globusdigital/deep-copy/some/sub/packages\n```\nHere is the full set of supported flags:\n\n```bash\ndeep-copy \\\n  [-o /output/path.go] \\\n  [--method DeepCopy] \\\n  [--pointer-receiver] \\\n  [--skip Selector1,Selector.Two --skip Selector2[i], Selector.Three[k]]\n  [--type Type1 --type Type2\\ \\\n  [--tags mytag,anotherTag ] \\ \\\n  /path/to/package/containing/type\n```\n\n## Example\n\nGiven the following types:\n\n```go\npackage pkg\n\ntype Foo struct {\n\tMap map[string]*Bar\n\tch  chan float32\n\tbaz Baz\n}\n\ntype Bar struct {\n\tIntV  int\n\tSlice []string\n}\n\ntype Baz struct {\n\tString        string\n\tStringPointer *string\n}\n```\n\nRunning `deep-copy --type Foo ./path/to/pkg` will generate:\n\n```go\n// Code generated by deep-copy --type Foo ./path/to/pkg; DO NOT EDIT.\n\npackage pkg\n\n// DeepCopy generates a deep copy of Foo\nfunc (o Foo) DeepCopy() Foo {\n\tvar cp Foo\n\tcp = o\n\tif o.Map != nil {\n\t\tcp.Map = make(map[string]*Bar, len(o.Map))\n\t\tfor k, v := range o.Map {\n\t\t\tvar cpv *Bar\n\t\t\tif v != nil {\n\t\t\t\tcpv = new(Bar)\n\t\t\t\t*cpv = *v\n\t\t\t\tif v.Slice != nil {\n\t\t\t\t\tcpv.Slice = make([]string, len(v.Slice))\n\t\t\t\t\tcopy(cpv.Slice, v.Slice)\n\t\t\t\t}\n\t\t\t}\n\t\t\tcp.Map[k] = cpv\n\t\t}\n\t}\n\tif o.ch != nil {\n\t\tcp.ch = make(chan float32, cap(o.ch))\n\t}\n\tif o.baz.StringPointer != nil {\n\t\tcp.baz.StringPointer = new(string)\n\t\t*cp.baz.StringPointer = *o.baz.StringPointer\n\t}\n\treturn cp\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobusdigital%2Fdeep-copy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglobusdigital%2Fdeep-copy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobusdigital%2Fdeep-copy/lists"}