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
+18.7k Golang : Set, Get and List environment variables
+4.9k Golang : How to pass data between controllers with JSON Web Token
+23.9k Find and replace a character in a string in Go
+11.3k CodeIgniter : How to check if a session exist in PHP?
+20.8k Golang : Saving private and public key to files
+16.8k Golang : Generate QR codes for Google Authenticator App and fix "Cannot interpret QR code" error
+9.8k Golang : Load ASN1 encoded DSA public key PEM file example
+6.4k Golang : Test input string for unicode example
+5.1k Golang : Calculate a pip value and distance to target profit example
+9.6k Golang : Convert(cast) string to int64
+52.8k Golang : How to get struct field and value by name
+5.7k Golang : Shortening import identifier