Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

[Enhancement] allow go_version prompt to work with go modules #1287

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion segments/go_version/go_version.p9k
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ prompt_go_version() {
go_version=$(go version 2>/dev/null | sed -E "s/.*(go[0-9.]*).*/\1/")
go_path=$(go env GOPATH 2>/dev/null)

if [[ -n "$go_version" && "${PWD##$go_path}" != "$PWD" ]]; then
if [[ -n "$go_version" && ("${PWD##$go_path}" != "$PWD" || -f "$PWD/go.mod") ]]; then
p9k::prepare_segment "$0" "" $1 "$2" $3 "$go_version"
fi
}