~dobey/go-unityscopes/fix-typo

« back to all changes in this revision

Viewing changes to activationresponse.go

  • Committer: Xavi Garcia
  • Date: 2015-03-19 13:33:42 UTC
  • mfrom: (54.1.19 v1)
  • Revision ID: xavi.garcia.mena@canonical.com-20150319133342-kxg0jgf773se14fr
merged branch lp:~xavi-garcia-mena/go-unityscopes/unit-tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
package scopes;
 
1
package scopes
2
2
 
3
3
// #include <stdlib.h>
4
4
// #include "shim.h"
22
22
// PerformAction() call on the scope to instruct the dash on what to
23
23
// do next.
24
24
type ActivationResponse struct {
25
 
        Status ActivationStatus
26
 
        Query *CannedQuery
 
25
        Status    ActivationStatus
 
26
        Query     *CannedQuery
27
27
        ScopeData interface{}
28
28
}
29
29
 
33
33
// ActivationPerformQuery response: use NewActivationResponseForQuery
34
34
// instead.
35
35
func NewActivationResponse(status ActivationStatus) *ActivationResponse {
36
 
        if (status == ActivationPerformQuery) {
 
36
        if status == ActivationPerformQuery {
37
37
                panic("Use NewActivationResponseFromQuery for PerformQuery responses")
38
38
        }
39
39
        return &ActivationResponse{
40
40
                Status: status,
41
 
                Query: nil,
 
41
                Query:  nil,
42
42
        }
43
43
}
44
44
 
47
47
func NewActivationResponseForQuery(query *CannedQuery) *ActivationResponse {
48
48
        return &ActivationResponse{
49
49
                Status: ActivationPerformQuery,
50
 
                Query: query,
 
50
                Query:  query,
51
51
        }
52
52
}
53
53