Title: Use generic optional type instead of pointers for changeset · Issue #3 · networkteam/construct · GitHub
Open Graph Title: Use generic optional type instead of pointers for changeset · Issue #3 · networkteam/construct
X Title: Use generic optional type instead of pointers for changeset · Issue #3 · networkteam/construct
Description: Bulding pointers to pointers can be tricky and need some extra lines of code. We could use a generic Optional type behind some command flag: type Optional[T any] struct { Valid bool Value T } func NewValidOptional[T any](value T) Optiona...
Open Graph Description: Bulding pointers to pointers can be tricky and need some extra lines of code. We could use a generic Optional type behind some command flag: type Optional[T any] struct { Valid bool Value T } func ...
X Description: Bulding pointers to pointers can be tricky and need some extra lines of code. We could use a generic Optional type behind some command flag: type Optional[T any] struct { Valid bool Value T } func ...
Opengraph URL: https://github.com/networkteam/construct/issues/3
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Use generic optional type instead of pointers for changeset","articleBody":"Bulding pointers to pointers can be tricky and need some extra lines of code.\r\n\r\nWe could use a generic `Optional` type behind some command flag:\r\n\r\n```\r\ntype Optional[T any] struct {\r\n\tValid bool\r\n\tValue T\r\n}\r\n\r\nfunc NewValidOptional[T any](value T) Optional[T] {\r\n\treturn Optional[T]{\r\n\t\tValid: true,\r\n\t\tValue: value,\r\n\t}\r\n}\r\n\r\nfunc NewEmptyOptional[T any]() Optional[T] {\r\n\treturn Optional[T]{\r\n\t\tValid: false,\r\n\t}\r\n}\r\n\r\nfunc init() {\r\n\tv1 := NewValidOptional(uuid.Nil)\r\n\tv2 := NewEmptyOptional[uuid.UUID]()\r\n\t\r\n}\r\n```","author":{"url":"https://github.com/hlubek","@type":"Person","name":"hlubek"},"datePublished":"2022-12-06T15:10:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/3/construct/issues/3"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c90f8f30-1fca-561c-1b2d-b695ca2aabb0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AAFA:9EA19:45F557:5AF37F:698E8304 |
| html-safe-nonce | aedda921b5d4a10a2fa06481c3f45d1eabe4d0a9f0fa7002ea35e36782b13a00 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQUZBOjlFQTE5OjQ1RjU1Nzo1QUYzN0Y6Njk4RTgzMDQiLCJ2aXNpdG9yX2lkIjoiNjY4ODg5NzkxMjk3MjE0OTUwOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f47044914debfd4862122552243f05148dc1d8b47824eee0ebb4d2632008323e |
| hovercard-subject-tag | issue:1479342007 |
| github-keyboard-shortcuts | repository,issues,network-graph,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/networkteam/construct/3/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0f949b49ec2e6b37dadd8a116a4968fa3886c5eb94e1719ecd1badd759ae8b62/networkteam/construct/issues/3 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0f949b49ec2e6b37dadd8a116a4968fa3886c5eb94e1719ecd1badd759ae8b62/networkteam/construct/issues/3 |
| og:image:alt | Bulding pointers to pointers can be tricky and need some extra lines of code. We could use a generic Optional type behind some command flag: type Optional[T any] struct { Valid bool Value T } func ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hlubek |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb2828a801ee6b7be618f3ac76fbf55def35bbc30f053a9c41bf90210b8b72ba |
| turbo-cache-control | no-preview |
| go-import | github.com/networkteam/construct git https://github.com/networkteam/construct.git |
| octolytics-dimension-user_id | 105948 |
| octolytics-dimension-user_login | networkteam |
| octolytics-dimension-repository_id | 301327570 |
| octolytics-dimension-repository_nwo | networkteam/construct |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 301327570 |
| octolytics-dimension-repository_network_root_nwo | networkteam/construct |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f7a12861f7011eecb14bcc4388a767d829a52dfc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width