{"id":15653831,"url":"https://github.com/mgechev/dots","last_synced_at":"2025-04-14T10:20:51.218Z","repository":{"id":46842493,"uuid":"120148582","full_name":"mgechev/dots","owner":"mgechev","description":"Implements the wildcard file matching in Go used by golint, go test etc.","archived":false,"fork":false,"pushed_at":"2021-09-22T19:15:27.000Z","size":20,"stargazers_count":28,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-06T18:00:01.250Z","etag":null,"topics":["glob","glob-pattern","golint","gotest","wildcard"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mgechev.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}},"created_at":"2018-02-04T02:31:52.000Z","updated_at":"2024-04-28T14:53:48.000Z","dependencies_parsed_at":"2022-09-16T23:00:37.912Z","dependency_job_id":null,"html_url":"https://github.com/mgechev/dots","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgechev%2Fdots","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgechev%2Fdots/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgechev%2Fdots/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgechev%2Fdots/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mgechev","download_url":"https://codeload.github.com/mgechev/dots/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248860005,"owners_count":21173343,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["glob","glob-pattern","golint","gotest","wildcard"],"created_at":"2024-10-03T12:47:14.303Z","updated_at":"2025-04-14T10:20:51.189Z","avatar_url":"https://github.com/mgechev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/mgechev/dots.svg?branch=master)](https://travis-ci.org/mgechev/dots)\n\n# Dots\n\nImplements the wildcard file matching in Go used by golint, go test etc.\n\n## Usage\n\n```go\nimport \"github.com/mgechev/dots\"\n\nfunc main() {\n  result, err := dots.Resolve([]string{\"./fixtures/...\"}, []string{\"./fixtures/foo\"})\n  for _, f := range result {\n    fmt.Println(f);\n  }\n}\n```\n\nIf we suppose that we have the following directory structure:\n\n```text\n├── README.md\n├── fixtures\n│   ├── bar\n│   │   ├── bar1.go\n│   │   └── bar2.go\n│   ├── baz\n│   │   ├── baz1.go\n│   │   ├── baz2.go\n│   │   └── baz3.go\n│   └── foo\n│       ├── foo1.go\n│       ├── foo2.go\n│       └── foo3.go\n└── main.go\n```\n\nThe result will be:\n\n```text\nfixtures/bar/bar1.go\nfixtures/bar/bar2.go\nfixtures/baz/baz1.go\nfixtures/baz/baz2.go\nfixtures/baz/baz3.go\n```\n\n`dots` supports wildcard in both - the first and the last argument of `Resolve`, which means that you can ignore files based on a wildcard:\n\n```go\ndots.Resolve([]string{\"github.com/mgechev/dots\"}, []string{\"./...\"}) // empty list\ndots.Resolve([]string{\"./fixtures/bar/...\"}, []string{\"./fixture/foo/...\", \"./fixtures/baz/...\"}) // bar1.go, bar2.go\n```\n\n## Preserve package structure\n\n`dots` allow you to receive a slice of slices where each nested slice represents an individual package:\n\n```go\ndots.ResolvePackages([]string{\"github.com/mgechev/dots/...\"}, []string{})\n```\n\nSo we will get the result:\n\n```text\n[\n  [\n    \"$GOROOT/src/github.com/mgechev/dots/fixtures/dummy/bar/bar1.go\",\n    \"$GOROOT/src/github.com/mgechev/dots/fixtures/dummy/bar/bar2.go\"\n  ],\n  [\n    \"$GOROOT/src/github.com/mgechev/dots/fixtures/dummy/baz/baz1.go\",\n    \"$GOROOT/src/github.com/mgechev/dots/fixtures/dummy/baz/baz2.go\",\n    \"$GOROOT/src/github.com/mgechev/dots/fixtures/dummy/baz/baz3.go\"\n  ],\n  [\n    \"$GOROOT/src/github.com/mgechev/dots/fixtures/dummy/foo/foo1.go\",\n    \"$GOROOT/src/github.com/mgechev/dots/fixtures/dummy/foo/foo2.go\",\n    \"$GOROOT/src/github.com/mgechev/dots/fixtures/dummy/foo/foo3.go\"\n  ],\n  [\n    \"$GOROOT/src/github.com/mgechev/dots/fixtures/pkg/baz/baz1.go\",\n    \"$GOROOT/src/github.com/mgechev/dots/fixtures/pkg/baz/baz2.go\"\n  ],\n  [\n    \"$GOROOT/src/github.com/mgechev/dots/fixtures/pkg/foo/foo1.go\",\n    \"$GOROOT/src/github.com/mgechev/dots/fixtures/pkg/foo/foo2.go\"\n  ],\n  [\n    \"$GOROOT/src/github.com/mgechev/dots/fixtures/pkg/foo/bar/bar1.go\"\n  ]\n]\n```\n\nThis method is especially useful, when you want to perform type checking over given package from the result.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgechev%2Fdots","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmgechev%2Fdots","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgechev%2Fdots/lists"}