gosense
·140 words·1 min
sense-go #
Sense the directories around you, are they git repositories, what language, etc.
Languages #
🐍 sense-py || 🦀 sense-rs || 🐹 gosense || 🇨 sense-c
Why? #
Why so many langs? #
Because I write projects pretty regularly in all of these languages and want a consistent API and available library support for all of them.
API #
Git #
has_git(path string) bool
is_local_git(path string) bool
Language #
get_lang(path string) Lang
Example #
func main() {
lang := get_lang("./")
fmt.Println(lang.String())
git := has_git("./")
if git {
fmt.Println("Is git!")
} else {
fmt.Println("Is not git.")
}
local := is_local_git("./")
if local {
fmt.Println("Is local!")
} else {
fmt.Println("Is not local.")
}
}
Supported langs #
- Python
- JavaScript
- Rust
- Java
- Go
- TypeScript
- C
- CPP
Contributing #
If you would like to add features or language support, that would be amazing!