Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
github.com/ders/menu
Package menu provides a data structure to represent nested menus such as those that might appear on a web page.
The basic unit is a ListItem, which may be either a List or an Item. An Item consists of a label (e.g. the text that appears, or perhaps a key to a translation table when localized text is needed) and an action (e.g. a url path). A List consists of a label and a list of ListItems.
An Item may optionally have a visibility mask, which may be used when certain parts of the menu need to be dynamically hidden. A example of when this might be useful is an admin submenu which is only visible to authenticated admin users.
The Filtered() method is used to hide parts of a menu based on a bitmask. The provided bitmask is and-ed with the visibility mask of each Item, and the item is shown only if the result is nonzero.
A visibility mask may also be applied to a List. If a List is hidden, all the Lists and Items under it are also hidden.
Menus hay have arbitrary depth, although recursive menus are not supported and will crash.
Menus play well with json.Marshal (see the examples).
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.