// VisitPackage checks the package.
VisitPackage checks the package.
// VisitPackage checks the package .
func (v *packageNameLowerCaseVisitor) VisitPackage(p *parser.Package) bool {
	name := p.Name
	if !isPackageLowerCase(name) {
		expected := strings.ToLower(name)
		v.AddFailuref(p.Meta.Pos, "Package name %q must not contain any uppercase letter. Consider to change like %q.", name, expected)
		err := v.Fixer.SearchAndReplace(p.Meta.Pos, func(lex *lexer.Lexer) fixer.TextEdit {
			lex.NextKeyword()
			ident, startPos, _ := lex.ReadFullIdent()
			return fixer.TextEdit{
				Pos:     startPos.Offset,
				End:     startPos.Offset + len(ident) - 1,
				NewText: []byte(expected),
			}
		})
		if err != nil {
			panic(err)
		}
	}
	return false
}
func ( v * packageNameLowerCaseVisitor ) VisitPackage ( p * parser . Package ) bool { name := p . Name if ! isPackageLowerCase ( name ) { expected := strings . ToLower ( name ) v . AddFailuref ( p . Meta . Pos , " " , name , expected ) err := v . Fixer . SearchAndReplace ( p . Meta . Pos , func ( lex * lexer . Lexer ) fixer . TextEdit { lex . NextKeyword ( ) ident , startPos , _ := lex . ReadFullIdent ( ) return fixer . TextEdit { Pos : startPos . Offset , End : startPos . Offset + len ( ident ) - 1 , NewText : [ ] byte ( expected ) , } } ) if err != nil { panic ( err ) } } return false }
VisitPackage checks the package.
VisitPackage checks the package .