Skip to content

Commit

Permalink
Update to address comments and linting.
Browse files Browse the repository at this point in the history
  • Loading branch information
drewsilcock committed Apr 29, 2024
1 parent 0cc9aea commit 1443dbf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion const.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ type ConstVariable struct {
Pkg *PackageDefinitions
}

// VariableName gets the bane for this const variable, taking into account comment overrides.
func (cv *ConstVariable) VariableName() string {
if ignoreNameOverride(cv.Name.Name) {
return cv.Name.Name[1:]
} else if overriddenName := nameOverride(cv.Comment); overriddenName != "" {
}

if overriddenName := nameOverride(cv.Comment); overriddenName != "" {
return overriddenName
}

Expand Down
4 changes: 3 additions & 1 deletion types.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ func (t *TypeSpecDef) Name() string {
func (t *TypeSpecDef) TypeName() string {
if ignoreNameOverride(t.TypeSpec.Name.Name) {
return t.TypeSpec.Name.Name[1:]
} else if overriddenName := nameOverride(t.TypeSpec.Comment); overriddenName != "" {
}

if overriddenName := nameOverride(t.TypeSpec.Comment); overriddenName != "" {
return overriddenName
}

Expand Down

0 comments on commit 1443dbf

Please sign in to comment.