GoLang Troubles?

PHPz
Release: 2024-09-08 22:32:40
Original
576 people have browsed it

GoLang Troubles?

So, it's been a few days and have had quite the ride trying to understand what's happening on the backend of the env. So, in my full admission, I made an oopsie in the last post regarding adding Go to your PATH.

I ran into an issue Friday (06/09, (it's always right before the week ends). I reached out to the developer of templ, a-h (huge thanks for pointing me in the right direction), with an issue about my css file being overwritten.

According to everything sent, all was okay. After a couple of days working on it. The issue became clear. My PATH was corrupted. How did I come to this conclusion?

templ generate: command not found

The issue, is not in the way PATH is set up but the ORDER in which it is set up.

Coming from Windie, over to Mac, I didn't consider a key and important aspect. When working in Windie, PATH can be deleted completely if not set correctly (typically can be reset by restarting the PC). On Linux based systems, this is less of a risk when working in the terminal.

"But how?" I hear. Simple, when working in the terminal, your $PATH is loaded into the env. So, by simply changing the code to look like so:

GOPATH=/path/to/go GOBIN="$GOPATH/bin" export PATH="$GOBIN:${PATH}"
Copy after login

we resolve the issue.

By appending $PATH to the end of the string, you're preventing duplicate paths. This was, in fact, the issue. Remember what I said last time? "If you run into any problems, I promise, it is mostly a path issue."

Good luck with your project(s) and may you have full bands ahead!

(If you're unsure of what "full bands" means, I have a post for that, coming as well)

The above is the detailed content of GoLang Troubles?. For more information, please follow other related articles on the PHP Chinese website!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!