'Does Go support nested type declarations or literal assignments to anonymous structs? [duplicate]

I'm new to Go and have two questions about types.

For example, take this code:

type Rule struct {
    handler func() (err error)
    creator string
    args struct {
        extension string
        action string
        folder struct {
            location string
            storage string
        }
    }
}

1) How can I create a new Rule using a single literal declaration and assign values to the properties of args? What is wrong with this code:

rule := Rule{
    args: {
        extension: "png,jpg,gif,svg",
        action: "move",
    },
}

2) Is it possible to define types within types? For instance, without breaking the code into two separate type declarations, could I modify the args portion of the Rule type so that it defines a second type called RuleArgs?

I know that I can break these out into multiple assignments and declarations, but my question is do I have to (ie. does Go make it impossible not to)?



Solution 1:[1]

You will get the following class to all the buttons which are loaded in adaptive cards which are under li element for each message:

.ac-actionSet .ac-pushButton

You have to do some logic in javascript or react based on this class and hide previous li elements buttons except current li element.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sanjeevi Subramani