adigunhammedolalekan / go-contacts Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hi,
I have an issue with trying to run the tutorial. When I run the program, I got the error "lens/utils" is not recognized in auth.go, accounts.go, and contacts.go . Is the line supposed to be
u "go-contacts/utils"? Thanks
Hi!
In line https://github.com/adigunhammedolalekan/go-contacts/blob/master/models/accounts.go#L44
you validate email from different aspects, one of them is to check it on duplicate emails in db
in line 41 code constantly returns ErrRecordNotFound and the all app doesn't work properly because of it
if edit conditions like this on line 42:
if err != nil && err == gorm.ErrRecordNotFound
logic will be fixed and server functions go well
Although you do have .idea
in .gitignore, it should be .idea/
to ignore whole .idea directory.
Also, it is in the repository, and I reckon it should not be there.
PS Mind if I do a bit of a cleanup? IMO, .env is a bit off the standard, and I would like to go fmt all the codebase
Hi!
Thank you for your very informative and helpful medium article on building REST APIs with Golang and JWT.
I noticed that your repository does not have a license and is thus technically illegal for others to use even though it appears that you wanted it openly available. More information can be found here. Would you mind adding a standard open source license so that other can use it as well? I would recommend using the MIT license unless you have a reason to use something else.
I would be happy to make a pull request for this if that would be easier for you.
Thanks!
Daniel Hill
Hello! First of all, i want to thank you, this was my first Go experience and it was very smooth. There is few order issues in your Medium post (so i wasn't able to compile the project as some parts were required before initialized), but it's OK, kind of short guide on "typical go import errors". What I'm talking about now is your db connection method - in github repo you just wrote static connection string, which is not really nice. In Medium article snippet builds the connection string, but don't use the port in .env file. My solution was very easy (as i read the gorm
docs about port first).
Like it was:
username := os.Getenv("db_user")
password := os.Getenv("db_pass")
dbName := os.Getenv("db_name")
dbHost := os.Getenv("db_host")
dbUri := fmt.Sprintf("host=%s user=%s dbname=%s sslmode=disable password=%s", dbHost, username, dbName, password)
My variant
username := os.Getenv("db_user")
password := os.Getenv("db_pass")
dbName := os.Getenv("db_name")
dbHost := os.Getenv("db_host")
dbPort := os.Getenv("db_port")
dbUri := fmt.Sprintf("host=%s port=%s user=%s dbname=%s sslmode=disable password=%s", dbHost, dbPort, username, dbName, password)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.