-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(example): r/mouss
#3472
base: master
Are you sure you want to change the base?
feat(example): r/mouss
#3472
Conversation
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
} | ||
|
||
func renderHomepage(res *mux.ResponseWriter, req *mux.Request) { | ||
var b bytes.Buffer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are you using a bytes.Buffer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback, i've updated the code,i use strings.Builder instead of bytes.Buffer it's more efficient for string concatenation. bytes.Buffer was just general purpose.
8f5cb186
if !isUser(caller) { | ||
return config.ErrorUnauthorized | ||
} | ||
if contains(profile.Followers, addr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like you should use the freshly merged addrset
library (#3448)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to run make install
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leohhhn
I did it , i get the same error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realized I forgot to set the home_page
branch to track master
as its upstream so i haven't the p/moul/addrset
in home_page
branch . sorry 🙏🏽
} | ||
|
||
func isUser(addr std.Address) bool { | ||
return !isAuthorized(addr) && !contains(profile.Followers, addr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't the if condition be checking the exacte opposite?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use isUser
to check if follower is not admin address or if the follower exist already in the list of followers. i still working on ,I think it's could be a good feature to follow and be followed by other users.
} | ||
|
||
func writeRecipe(b *bytes.Buffer, recipe *Recipe) { | ||
b.WriteString("## " + recipe.Name + "\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think that you should consider using a ui library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
res.Write(b.String()) | ||
} | ||
|
||
func writeRecipe(b *bytes.Buffer, recipe *Recipe) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func writeRecipe(b *bytes.Buffer, recipe *Recipe) { | |
func (r Recipe) Render() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also change writeProfile
to (p Profile)Render
4959189b
func writeProfile to method (p Profile)Render
Hi Gnomes ,
This is my home page. it was difficult to be creative 😅 , so i did what i can do
Home :
I put some informations about me
World kitchen :
I'm passionate about cooking, so I've set up a page for those who want to share their national culinary specialties or just their favorite recipes, since there are so many nationalities in
gno
community.feel free to add your recipes ;)
@leohhhn