Skip to content

Commit 753dd36

Browse files
author
Diwaker Gupta
committed
Lot of go lint fixes.
Still get a bunch of warnings, but the important ones are addressed by this commit.
1 parent 4bf1d6b commit 753dd36

File tree

22 files changed

+4015
-2799
lines changed

22 files changed

+4015
-2799
lines changed

dropbox/async/types.go

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1919
// THE SOFTWARE.
2020

21+
// Package async : has no documentation (yet)
2122
package async
2223

2324
import (
@@ -26,21 +27,25 @@ import (
2627
"github.com/dropbox/dropbox-sdk-go-unofficial/dropbox"
2728
)
2829

29-
// Result returned by methods that launch an asynchronous job. A method who may
30-
// either launch an asynchronous job, or complete the request synchronously, can
31-
// use this union by extending it, and adding a 'complete' field with the type
32-
// of the synchronous response. See `LaunchEmptyResult` for an example.
30+
// LaunchResultBase : Result returned by methods that launch an asynchronous
31+
// job. A method who may either launch an asynchronous job, or complete the
32+
// request synchronously, can use this union by extending it, and adding a
33+
// 'complete' field with the type of the synchronous response. See
34+
// `LaunchEmptyResult` for an example.
3335
type LaunchResultBase struct {
3436
dropbox.Tagged
35-
// This response indicates that the processing is asynchronous. The string
36-
// is an id that can be used to obtain the status of the asynchronous job.
37+
// AsyncJobId : This response indicates that the processing is asynchronous.
38+
// The string is an id that can be used to obtain the status of the
39+
// asynchronous job.
3740
AsyncJobId string `json:"async_job_id,omitempty"`
3841
}
3942

43+
// Valid tag values for LaunchResultBase
4044
const (
41-
LaunchResultBase_AsyncJobId = "async_job_id"
45+
LaunchResultBaseAsyncJobId = "async_job_id"
4246
)
4347

48+
// UnmarshalJSON deserializes into a LaunchResultBase instance
4449
func (u *LaunchResultBase) UnmarshalJSON(body []byte) error {
4550
type wrap struct {
4651
dropbox.Tagged
@@ -60,59 +65,66 @@ func (u *LaunchResultBase) UnmarshalJSON(body []byte) error {
6065
return nil
6166
}
6267

63-
// Result returned by methods that may either launch an asynchronous job or
64-
// complete synchronously. Upon synchronous completion of the job, no additional
65-
// information is returned.
68+
// LaunchEmptyResult : Result returned by methods that may either launch an
69+
// asynchronous job or complete synchronously. Upon synchronous completion of
70+
// the job, no additional information is returned.
6671
type LaunchEmptyResult struct {
6772
dropbox.Tagged
6873
}
6974

75+
// Valid tag values for LaunchEmptyResult
7076
const (
71-
LaunchEmptyResult_Complete = "complete"
77+
LaunchEmptyResultComplete = "complete"
7278
)
7379

74-
// Arguments for methods that poll the status of an asynchronous job.
80+
// PollArg : Arguments for methods that poll the status of an asynchronous job.
7581
type PollArg struct {
76-
// Id of the asynchronous job. This is the value of a response returned from
77-
// the method that launched the job.
82+
// AsyncJobId : Id of the asynchronous job. This is the value of a response
83+
// returned from the method that launched the job.
7884
AsyncJobId string `json:"async_job_id"`
7985
}
8086

87+
// NewPollArg returns a new PollArg instance
8188
func NewPollArg(AsyncJobId string) *PollArg {
8289
s := new(PollArg)
8390
s.AsyncJobId = AsyncJobId
8491
return s
8592
}
8693

87-
// Result returned by methods that poll for the status of an asynchronous job.
88-
// Unions that extend this union should add a 'complete' field with a type of
89-
// the information returned upon job completion. See `PollEmptyResult` for an
90-
// example.
94+
// PollResultBase : Result returned by methods that poll for the status of an
95+
// asynchronous job. Unions that extend this union should add a 'complete' field
96+
// with a type of the information returned upon job completion. See
97+
// `PollEmptyResult` for an example.
9198
type PollResultBase struct {
9299
dropbox.Tagged
93100
}
94101

102+
// Valid tag values for PollResultBase
95103
const (
96-
PollResultBase_InProgress = "in_progress"
104+
PollResultBaseInProgress = "in_progress"
97105
)
98106

99-
// Result returned by methods that poll for the status of an asynchronous job.
100-
// Upon completion of the job, no additional information is returned.
107+
// PollEmptyResult : Result returned by methods that poll for the status of an
108+
// asynchronous job. Upon completion of the job, no additional information is
109+
// returned.
101110
type PollEmptyResult struct {
102111
dropbox.Tagged
103112
}
104113

114+
// Valid tag values for PollEmptyResult
105115
const (
106-
PollEmptyResult_Complete = "complete"
116+
PollEmptyResultComplete = "complete"
107117
)
108118

109-
// Error returned by methods for polling the status of asynchronous job.
119+
// PollError : Error returned by methods for polling the status of asynchronous
120+
// job.
110121
type PollError struct {
111122
dropbox.Tagged
112123
}
113124

125+
// Valid tag values for PollError
114126
const (
115-
PollError_InvalidAsyncJobId = "invalid_async_job_id"
116-
PollError_InternalError = "internal_error"
117-
PollError_Other = "other"
127+
PollErrorInvalidAsyncJobId = "invalid_async_job_id"
128+
PollErrorInternalError = "internal_error"
129+
PollErrorOther = "other"
118130
)

dropbox/auth/client.go

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1919
// THE SOFTWARE.
2020

21+
// Package auth : has no documentation (yet)
2122
package auth
2223

2324
import (
@@ -29,14 +30,17 @@ import (
2930
"github.com/dropbox/dropbox-sdk-go-unofficial/dropbox"
3031
)
3132

33+
// Client interface describes all routes in this namespace
3234
type Client interface {
33-
// Disables the access token used to authenticate the call.
35+
// TokenRevoke : Disables the access token used to authenticate the call.
3436
TokenRevoke() (err error)
3537
}
3638

3739
type apiImpl dropbox.Context
38-
type TokenRevokeApiError struct {
39-
dropbox.ApiError
40+
41+
//TokenRevokeAPIError is an error-wrapper for the token/revoke route
42+
type TokenRevokeAPIError struct {
43+
dropbox.APIError
4044
EndpointError struct{} `json:"error"`
4145
}
4246

@@ -48,8 +52,8 @@ func (dbx *apiImpl) TokenRevoke() (err error) {
4852
return
4953
}
5054

51-
if dbx.Config.AsMemberId != "" {
52-
req.Header.Set("Dropbox-API-Select-User", dbx.Config.AsMemberId)
55+
if dbx.Config.AsMemberID != "" {
56+
req.Header.Set("Dropbox-API-Select-User", dbx.Config.AsMemberID)
5357
}
5458
if dbx.Config.Verbose {
5559
log.Printf("req: %v", req)
@@ -73,15 +77,15 @@ func (dbx *apiImpl) TokenRevoke() (err error) {
7377
}
7478
if resp.StatusCode != 200 {
7579
if resp.StatusCode == 409 {
76-
var apiError TokenRevokeApiError
80+
var apiError TokenRevokeAPIError
7781
err = json.Unmarshal(body, &apiError)
7882
if err != nil {
7983
return
8084
}
8185
err = apiError
8286
return
8387
}
84-
var apiError dropbox.ApiError
88+
var apiError dropbox.APIError
8589
if resp.StatusCode == 400 {
8690
apiError.ErrorSummary = string(body)
8791
err = apiError
@@ -97,6 +101,7 @@ func (dbx *apiImpl) TokenRevoke() (err error) {
97101
return
98102
}
99103

104+
// New returns a Client implementation for this namespace
100105
func New(c dropbox.Config) *apiImpl {
101106
ctx := apiImpl(dropbox.NewContext(c))
102107
return &ctx

dropbox/auth/types.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,20 @@
1818
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1919
// THE SOFTWARE.
2020

21+
// Package auth : has no documentation (yet)
2122
package auth
2223

2324
import "github.com/dropbox/dropbox-sdk-go-unofficial/dropbox"
2425

25-
// Errors occurred during authentication.
26+
// AuthError : Errors occurred during authentication.
2627
type AuthError struct {
2728
dropbox.Tagged
2829
}
2930

31+
// Valid tag values for AuthError
3032
const (
31-
AuthError_InvalidAccessToken = "invalid_access_token"
32-
AuthError_InvalidSelectUser = "invalid_select_user"
33-
AuthError_InvalidSelectAdmin = "invalid_select_admin"
34-
AuthError_Other = "other"
33+
AuthErrorInvalidAccessToken = "invalid_access_token"
34+
AuthErrorInvalidSelectUser = "invalid_select_user"
35+
AuthErrorInvalidSelectAdmin = "invalid_select_admin"
36+
AuthErrorOther = "other"
3537
)

dropbox/common/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@
1818
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1919
// THE SOFTWARE.
2020

21+
// Package common : has no documentation (yet)
2122
package common

0 commit comments

Comments
 (0)