Removes usage of library methods that are not available in 1.11 #74
No reviewers
Labels
No Label
blocked
bug
build
documentation
duplicate
enhancement
finger
gemini
gopher
help wanted
http
in progress
invalid
local
needs-info
non-code
non-functional
non-urgent
question
release
rendering
suggestion
telnet
terminal
urgent
wontfix
No Milestone
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sloum/bombadillo#74
Loading…
Reference in New Issue
No description provided.
Delete Branch "remove-replace-all"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It turns out that two methods being used (
strings.ReplaceAll
andos.UserHomeDir
) are only available for 1.12+. Since I was hoping to support1.11
, which is what we have in the readme and mod file, I updated the code to use alternate methods.In the case of
ReplaceAll
I looked at the 1.12 source code andReplaceAll
is just a wrapper forReplace
that lets you avoid adding-1
as a param.For
os.UserHomeDir
I changed it to use what we were already using indefaults.go
:user.Current
followed by_.HomeDir
(where_
is the return fromuser.Current
).This should make it build and have the same functionality for Go 1.11 users. I dont think we can realistically support any earlier than that.
I looked around for tooling that would let us know, based on the standard lib methods and other features being used, what versions we support... but was unable to find anything. This may be in part because I do not use google for search (duckduckgo instead) and sometimes cannot get what I am hoping for... but it is also possible that such a thing just doesnt exist.