تخطَّ إلى المحتوى

Interface no I prefix (ARCH5003)

هذا المحتوى غير متوفر بلغتك بعد.

Key go.naming.interface-no-i-prefix · Severity info · Category naming

Go interfaces should not be prefixed with I; that C#/Java habit is not idiomatic in Go. Interfaces are usually named after their behavior with an -er suffix.

type IReader interface {
Read(p []byte) (int, error)
}
type Reader interface {
Read(p []byte) (int, error)
}

Drop the I prefix and use a behavior-oriented name such as Reader.