Unix/Linux/MacOSx : How to remove an environment variable ?
Somehow I screwed up my GOPATH and GOROOT environment variables today and removing (sudo yum remove ) Go did not help. A quick check revealed the old environment variables are still around.
Problem :
How to remove the unwanted environment variables ?
Solution :
Use unset
command. unset <environment variable>
For example :
unset GOROOT
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+11.6k Golang : Drop cookie to visitor's browser and http.SetCookie() example
+12.8k Golang: Pad right or print ending(suffix) zero or spaces in fmt.Printf example
+23.7k Golang : Convert long hexadecimal with strconv.ParseUint example
+18.5k Golang : Append content to a file
+7.6k Golang : Set or add headers for many or different handlers
+3.9k Unix/Linux : How to pipe/save output of a command to file?
+33.8k Golang : Save image to PNG, JPEG or GIF format.
+12.9k Golang : Google Drive API upload and rename example
+38.8k Golang : How do I convert int to uint8?
+19.9k Golang : Encrypt and decrypt data with TripleDES
+21.2k Golang : Set and Get HTTP request headers example
+6k Golang : Get environment variable