~dobey/go-unityscopes/fix-typo

« back to all changes in this revision

Viewing changes to query.go

  • Committer: Rodney Dawes
  • Author(s): James Henstridge
  • Date: 2016-10-03 20:26:39 UTC
  • mfrom: (73.1.11 v2)
  • Revision ID: rodney.dawes@canonical.com-20161003202639-6qnaojpfps0vk11q
Update code to work with Go 1.6's new cgo pointer handling rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
// query string and department ID.
33
33
func NewCannedQuery(scopeID, queryString, departmentID string) *CannedQuery {
34
34
        return makeCannedQuery(C.new_canned_query(
35
 
                unsafe.Pointer(&scopeID),
36
 
                unsafe.Pointer(&queryString),
37
 
                unsafe.Pointer(&departmentID)))
 
35
                strData(scopeID),
 
36
                strData(queryString),
 
37
                strData(departmentID)))
38
38
}
39
39
 
40
40
// ScopeID returns the scope ID for this canned query.
72
72
 
73
73
// SetDepartmentID changes the department ID for this canned query.
74
74
func (query *CannedQuery) SetDepartmentID(departmentID string) {
75
 
        C.canned_query_set_department_id(query.q, unsafe.Pointer(&departmentID))
 
75
        C.canned_query_set_department_id(query.q, strData(departmentID))
76
76
}
77
77
 
78
78
// SetQueryString changes the query string for this canned query.
79
79
func (query *CannedQuery) SetQueryString(queryString string) {
80
 
        C.canned_query_set_query_string(query.q, unsafe.Pointer(&queryString))
 
80
        C.canned_query_set_query_string(query.q, strData(queryString))
81
81
}
82
82
 
83
83
// ToURI formats the canned query as a URI.