feat: cache module name of path

main
sudo pacman -Syu 2022-11-26 12:40:34 +07:00
parent 7f351b49f6
commit f6471ab9d6
No known key found for this signature in database
GPG Key ID: D6CB5C6C567C47B0
1 changed files with 4 additions and 0 deletions

View File

@ -303,6 +303,10 @@ func (ft *Formatter) moduleName(path string) (string, error) {
return "", ErrGoModEmptyModule
}
ft.muModuleNames.Lock()
ft.moduleNames[path] = result
ft.muModuleNames.Unlock()
return result, nil
}