https://github.com/namchee/go-clean-interface
No `I` prefix or `Itf` suffix in your Golang interfaces please!
https://github.com/namchee/go-clean-interface
go golang golangci-lint linter
Last synced: 3 months ago
JSON representation
No `I` prefix or `Itf` suffix in your Golang interfaces please!
- Host: GitHub
- URL: https://github.com/namchee/go-clean-interface
- Owner: Namchee
- License: mit
- Created: 2023-02-21T14:59:00.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-22T12:55:08.000Z (over 2 years ago)
- Last Synced: 2025-01-30T03:28:03.195Z (5 months ago)
- Topics: go, golang, golangci-lint, linter
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-clean-interface
Checks interface declarations for unnecessary `I` prefixes or `Itf` suffixes.
## Why?
[Main Reasoning](https://stackoverflow.com/a/5817904)
Prefixing interfaces with `I` or suffixing them with `Itf` is leftover convention from Java and C#. When we are writing code with clean architecture as a guideline, whatever we pass as a dependency should be expected as an interface.
Interfaces shouldn't be treated as a special language feature that requires special naming conventions.
## Installation
```shell
go install github.com/Namchee/go-clean-interface@latest
```## Usage
```shell
go-clean-interface [-flag] [package]
```## Options
All options are provided through CLI flags.
Name | Type | Default | Description
---- | ---- | ------- | -----------
`no-prefix` | `bool` | `true` | Disallow interface declarations to be prefixed with `I`
`no-suffix` | `bool` | `true` | Disallow interface declarations to be suffixed with `Itf`