fix(lint): 修复所有 Go 命名规范问题
- 全局替换 ApiKey → APIKey(类型、字段、方法、变量) - 修复所有 initialism 命名(API, SMTP, HTML, URL 等) - 添加所有缺失的包注释 - 修复导出符号的注释格式 主要修改: - ApiKey → APIKey(所有出现的地方) - ApiKeyID → APIKeyID - ApiKeyIDs → APIKeyIDs - TestSmtpConnection → TestSMTPConnection - HtmlURL → HTMLURL - 添加 20+ 个包注释 - 修复 10+ 个导出符号注释格式 验证结果: - ✓ golangci-lint: 0 issues - ✓ 单元测试: 通过 - ✓ 集成测试: 通过
This commit is contained in:
@@ -48,7 +48,7 @@ type User struct {
|
||||
// UserEdges holds the relations/edges for other nodes in the graph.
|
||||
type UserEdges struct {
|
||||
// APIKeys holds the value of the api_keys edge.
|
||||
APIKeys []*ApiKey `json:"api_keys,omitempty"`
|
||||
APIKeys []*APIKey `json:"api_keys,omitempty"`
|
||||
// RedeemCodes holds the value of the redeem_codes edge.
|
||||
RedeemCodes []*RedeemCode `json:"redeem_codes,omitempty"`
|
||||
// Subscriptions holds the value of the subscriptions edge.
|
||||
@@ -70,7 +70,7 @@ type UserEdges struct {
|
||||
|
||||
// APIKeysOrErr returns the APIKeys value or an error if the edge
|
||||
// was not loaded in eager-loading.
|
||||
func (e UserEdges) APIKeysOrErr() ([]*ApiKey, error) {
|
||||
func (e UserEdges) APIKeysOrErr() ([]*APIKey, error) {
|
||||
if e.loadedTypes[0] {
|
||||
return e.APIKeys, nil
|
||||
}
|
||||
@@ -255,7 +255,7 @@ func (_m *User) Value(name string) (ent.Value, error) {
|
||||
}
|
||||
|
||||
// QueryAPIKeys queries the "api_keys" edge of the User entity.
|
||||
func (_m *User) QueryAPIKeys() *ApiKeyQuery {
|
||||
func (_m *User) QueryAPIKeys() *APIKeyQuery {
|
||||
return NewUserClient(_m.config).QueryAPIKeys(_m)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user