go-unityscopes v2 lacks some useful functions

Bug #1557964 reported by Gary.Wang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
go-unityscopes
New
Undecided
Unassigned

Bug Description

1.We now are not able to use the following functions just like the way we use in C++
  - setUserData()
  - Userdata()
  - HasUserdata()

2. Also no way to push widgets list over []PreviewWidget which makes it harder to push widgets in some cases in elegant way.
e.g. reply.PushWidgetsList(widget1, widget2, widget3..... widget100)

The following way may look better
widgets := make([]scopes.PreviewWidget, 0)

for index := 100; index >= 0; index-- {
     comment := scopes.NewPreviewWidget("comment"+strconv.Itoa(index), "comment")
     ....
     widgets = append(widgets, comment)
}

reply.PushWidgetsList(widgets)

Revision history for this message
Gary.Wang (gary-wzl77) wrote :
Revision history for this message
James Henstridge (jamesh) wrote :

Sorry for not getting back to you promptly on this bug report.

We'll look at adding the extra API for [1].

For [2], that idiom already works if you change the last line to "reply.PushWidgets(widgets...)". That's three extra characters for this unusual case, while changing the call signature would add 24 characters to the simpler common case.

Revision history for this message
Gary.Wang (gary-wzl77) wrote :

OK. Thanks for letting me know.
Forget I can use three extra characters to ease my life when appending multiple widgets.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.