{"id":17829643,"url":"https://github.com/guidefari/snippetbox","last_synced_at":"2025-04-02T11:42:54.280Z","repository":{"id":191766693,"uuid":"685350634","full_name":"guidefari/snippetbox","owner":"guidefari","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-25T19:23:25.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T02:44:29.327Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guidefari.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-31T03:23:05.000Z","updated_at":"2023-09-21T05:52:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"2ba87bd0-0b19-49cd-84e8-c6b1f2fe0112","html_url":"https://github.com/guidefari/snippetbox","commit_stats":null,"previous_names":["txndai/snippetbox","guidefari/snippetbox"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guidefari%2Fsnippetbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guidefari%2Fsnippetbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guidefari%2Fsnippetbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guidefari%2Fsnippetbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guidefari","download_url":"https://codeload.github.com/guidefari/snippetbox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246811235,"owners_count":20837745,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-27T19:16:53.551Z","updated_at":"2025-04-02T11:42:53.693Z","avatar_url":"https://github.com/guidefari.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"- Following the book [Let's Go](https://lets-go.alexedwards.net/)\n- `chmod +x ./run.sh` if it refuses to execute\n\n## TIL - Block action\n\n\u003e This acts like the {{template}} action, except it allows you to specify some default content if the template being invoked doesn’t exist in the current template set.\n\u003e In the context of a web application, this is useful when you want to provide some default content (such as a sidebar) which individual pages can override on a case-by-case basis if they need to.\n\n```html\n{{define \"base\"}}\n\u003ch1\u003eAn example template\u003c/h1\u003e\n{{block \"sidebar\" .}}\n\u003cp\u003eMy default sidebar content\u003c/p\u003e\n{{end}} {{end}}\n```\n\n## TIL - Additional info about Go's file server\n\n- It sanitizes all request paths by running them through `path.Clean`\n  - this helps stop directory traversal attacks\n- [Range requests](https://benramsey.com/blog/2008/05/206-partial-content-and-range-requests)\n  are fully supported. This is great for resumable downloads!\n\n## TIL - All incoming http requests are handled concurrently\n\nYes, blazingly fast, but be aware of race conditions when accessing\nshared resources\n\n## TIL - Command line flags\n\n`addrVariable := flag.String(\"addr\", \":4000\", \"HTTP network address\")`\n\n- This takes the flag `addr` from the command line\n- Sets a default value of `\":4000\"`\n- Gives it some helper text\n\n## Do a deep dive on function signatures\n\n```go\n// Change the signature of the home handler so it is defined as a method against // *application.\nfunc (app *application) home(w http.ResponseWriter, r *http.Request) {\n\n// as seen in handler.go\n```\n\n- my question is especially centered around `func (app *application)`\n- learning module resolution and package management will probably be helpful tooo\n  - that \\*application exists in `main.go`\n\n## What is a struct, really?\n\n- various use cases\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguidefari%2Fsnippetbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguidefari%2Fsnippetbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguidefari%2Fsnippetbox/lists"}