[Solved] Understanding GO variable assignment


As @Sergio Tulentsev pointed out, you are assigning ModifyDBClusterSnapshotAttributeInput type to the variable input, that is a CreateDBClusterSnapshotInput type.

There would be a few solutions to handle this problem, but the easiest way would be to make a method for each type struct that returns a compatible type for input like this;

func (createInput CreateDBClusterSnapshotInput) ReturnInput() {
    return createInput.input // assuming that there are a input type your create
}

If you don’t want to make a method with the same functionality for each struct, you can create a base type, make your two structs extend the type, and build a method for the base type.

solved Understanding GO variable assignment