Hey mate, for the env file, when I try to copy paste the code for testing purposes, I removed the os.Getenv just as to not make env variables, what should I put? For example, servLoc = "local"? Because I get errors in main.go and email.go files pertaining to those variables as "undefined"
@GrowAdept10 ай бұрын
At the start of the video I should have explained how to run multiple files that are all part of "package main". For instance main.go and env.go both have "package main" at the top, which is still appropriate when breaking code into more organized files. They are both part of package main, as well as some other files. Unfortunately I should have mentioned that we can't just use "go run main.go" to run our app. That would run the main.go file but the env.go file will not populate our variables for us. Solution: use "go run ." to run all the files in this directory and it should work. Please note the ".", because "go run" without it won't work, it says to use all the files in current directory. So now you should be able to save servLoc = "local" and it should work. This is useful to know as some Github projects also have multiple files for package main. I hope this helps and happy coding!
@iCrimzon10 ай бұрын
@@GrowAdept one more question, ive been trying to debug it for forever but all the files are package main yet i still have errors under servLoc and fromEmail etc, do i need to import the other files into my main.go or what? I tried importing them but still had errors, or does go run . solve this issue as well
@hiyoutube6769 Жыл бұрын
the very good lesson. Thank you bro
@GrowAdept Жыл бұрын
You are very welcome, I am glad it was helpful. :)
@NitroBrewbell7 ай бұрын
Does the email verification function need to check for timeout period if it elapsed ? I don't see a line for check. Perhaps the database is expunging it automatically but I highly doubt it.
@GrowAdept7 ай бұрын
Good catch. Looking at emailverGEThandler() there is a check that username exists, and that the given password matches with the saved hash in the database, but I don't see a check for the timeout period. Thank you for catching this, I will need to add this check. If it fails, we will also need code to either send a reminder email, provide another verification option or purge the unverified account.
@myotun92712 жыл бұрын
new to go and web dev general. huge thanks for this! how should the folders/files be organised to keep it clean/organised?
@GrowAdept2 жыл бұрын
Glad to hear someone new is learning Go, welcome. Try this vid kzbin.info/www/bejne/sJnLhJ-arbWHeNk it explains some of the concepts of how and when to split up code as well as some of the pathing for imports. Let me know if this helps, cheers!
@bellosegun2 жыл бұрын
Wow ...just found your channel..been looking for this kind of content..I appreciate your effort and the world wide web does too... What about refresh tokens, forgot password and revalidate email incase the first one expires. Are these coming up?
@GrowAdept2 жыл бұрын
Thank you very much, glad the content is useful. The forgot password account recovery vid is up in a few hours. I plan on eventually doing a series of videos on tokens but have a project to do first.
@bellosegun2 жыл бұрын
Wow …. Thanks so far…
@flamejoy2843 Жыл бұрын
thx for lesson
@GrowAdept Жыл бұрын
You are welcome. :)
@Krishna-bz5bs2 жыл бұрын
GitHub link for code?
@GrowAdept2 жыл бұрын
Thank you, I forgot that, go ahead are refresh and it should be there.