{"id":19114609,"url":"https://github.com/aligator/nogo","last_synced_at":"2026-04-21T16:04:04.512Z","repository":{"id":40743391,"uuid":"430376993","full_name":"aligator/NoGo","owner":"aligator","description":"A .gitignore parsing lib in pure Go","archived":false,"fork":false,"pushed_at":"2023-05-30T14:58:23.000Z","size":98,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-28T04:38:05.652Z","etag":null,"topics":["files","git","gitignore","go","ignore","lib","parser"],"latest_commit_sha":null,"homepage":"","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/aligator.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":"2021-11-21T13:39:21.000Z","updated_at":"2023-07-13T20:40:31.000Z","dependencies_parsed_at":"2024-06-20T02:02:00.055Z","dependency_job_id":"704e0cb7-a70c-46d5-abae-951afe3778d7","html_url":"https://github.com/aligator/NoGo","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/aligator/NoGo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aligator%2FNoGo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aligator%2FNoGo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aligator%2FNoGo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aligator%2FNoGo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aligator","download_url":"https://codeload.github.com/aligator/NoGo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aligator%2FNoGo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263379515,"owners_count":23457860,"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":["files","git","gitignore","go","ignore","lib","parser"],"created_at":"2024-11-09T04:44:00.929Z","updated_at":"2026-04-21T16:04:04.477Z","avatar_url":"https://github.com/aligator.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NoGo [![test](https://github.com/aligator/nogo/actions/workflows/test.yaml/badge.svg)](https://github.com/aligator/nogo/actions/workflows/test.yaml) [![CodeQL](https://github.com/aligator/nogo/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/aligator/nogo/actions/workflows/codeql-analysis.yml)\nA .gitignore parser for Go.\n\n## Features\n* parsing .gitignore files\n* loading file trees with several .gitignore files\n* fs.WalkDir WalkDirFunc implementation (and afero.Walk (see below))\n* customizable ignore filename (instead of .gitignore)\n* full compatibility with git  \nAs far as I could test it, it handles .gitignore files the same way as git.  \nIf you find an inconsistency with git, please create a new Issue.  \nThe goal is to provide the exact same .gitignore handling.\n\n## Stability\nNote that this lib is currently beta and therefore may introduce breaking changes.\nHowever I don't think much will change.\n\n## Usage\n```go\nn := nogo.New(nogo.DotGitRule)\nif err := n.AddFromFS(wdfs, \".gitignore\"); err != nil {\n    panic(err)\n}\n\nmatch := n.Match(toSearch, isDir)\nfmt.Println(match)\n```\n\nThere is also an alternative MatchBecause method which returns also\nthe causing rule if you need some context.\n\nThere exists a predefined rule to ignore any `.git` folder automatically.\n```go\nn := nogo.New(nogo.DotGitRule)\nif err := n.AddFromFS(wdfs, \".gitignore\"); err != nil {\n    panic(err)\n}\n```\n\n## Walk\nNoGo can be used with fs.WalkDir. [Just see the example walk.](example/walk/main.go)\nIf you need to use another Walk function, you can build your own wrapper using \nthe `NoGo.WalkFunc` function. \n\nI intentionally did not include an afero walk to avoid a new dependency\njust because of afero-compatibility. However, you can easily build your own.  \nYou can find an example for afero in the documentation of `NoGo.WalkFunc`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faligator%2Fnogo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faligator%2Fnogo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faligator%2Fnogo/lists"}