From 1317fdb9b85b5b3f38984a595a11a0878541eb0c Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 11 Nov 2024 17:54:59 +0000 Subject: [PATCH] build: fix comments after golangci-lint upgrade --- backend/onedrive/api/types.go | 32 ++++++++++++++++++++++---------- cmd/bisync/log.go | 3 ++- lib/multipart/multipart.go | 3 ++- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/backend/onedrive/api/types.go b/backend/onedrive/api/types.go index 0332f1c12..7fe032c23 100644 --- a/backend/onedrive/api/types.go +++ b/backend/onedrive/api/types.go @@ -202,9 +202,14 @@ type SharingLinkType struct { type LinkType string const ( - ViewLinkType LinkType = "view" // ViewLinkType (role: read) A view-only sharing link, allowing read-only access. - EditLinkType LinkType = "edit" // EditLinkType (role: write) An edit sharing link, allowing read-write access. - EmbedLinkType LinkType = "embed" // EmbedLinkType (role: read) A view-only sharing link that can be used to embed content into a host webpage. Embed links are not available for OneDrive for Business or SharePoint. + // ViewLinkType (role: read) A view-only sharing link, allowing read-only access. + ViewLinkType LinkType = "view" + // EditLinkType (role: write) An edit sharing link, allowing read-write access. + EditLinkType LinkType = "edit" + // EmbedLinkType (role: read) A view-only sharing link that can be used to embed + // content into a host webpage. Embed links are not available for OneDrive for + // Business or SharePoint. + EmbedLinkType LinkType = "embed" ) // LinkScope represents the scope of the link represented by this permission. @@ -212,9 +217,12 @@ const ( type LinkScope string const ( - AnonymousScope LinkScope = "anonymous" // AnonymousScope = Anyone with the link has access, without needing to sign in. This may include people outside of your organization. - OrganizationScope LinkScope = "organization" // OrganizationScope = Anyone signed into your organization (tenant) can use the link to get access. Only available in OneDrive for Business and SharePoint. - + // AnonymousScope = Anyone with the link has access, without needing to sign in. + // This may include people outside of your organization. + AnonymousScope LinkScope = "anonymous" + // OrganizationScope = Anyone signed into your organization (tenant) can use the + // link to get access. Only available in OneDrive for Business and SharePoint. + OrganizationScope LinkScope = "organization" ) // PermissionsType provides information about a sharing permission granted for a DriveItem resource. @@ -236,10 +244,14 @@ type PermissionsType struct { type Role string const ( - ReadRole Role = "read" // ReadRole provides the ability to read the metadata and contents of the item. - WriteRole Role = "write" // WriteRole provides the ability to read and modify the metadata and contents of the item. - OwnerRole Role = "owner" // OwnerRole represents the owner role for SharePoint and OneDrive for Business. - MemberRole Role = "member" // MemberRole represents the member role for SharePoint and OneDrive for Business. + // ReadRole provides the ability to read the metadata and contents of the item. + ReadRole Role = "read" + // WriteRole provides the ability to read and modify the metadata and contents of the item. + WriteRole Role = "write" + // OwnerRole represents the owner role for SharePoint and OneDrive for Business. + OwnerRole Role = "owner" + // MemberRole represents the member role for SharePoint and OneDrive for Business. + MemberRole Role = "member" ) // PermissionsResponse is the response to the list permissions method diff --git a/cmd/bisync/log.go b/cmd/bisync/log.go index 0d7f4b2f7..7dce79176 100644 --- a/cmd/bisync/log.go +++ b/cmd/bisync/log.go @@ -66,7 +66,8 @@ func quotePath(path string) string { return escapePath(path, true) } -var Colors bool // Colors controls whether terminal colors are enabled +// Colors controls whether terminal colors are enabled +var Colors bool // Color handles terminal colors for bisync func Color(style string, s string) string { diff --git a/lib/multipart/multipart.go b/lib/multipart/multipart.go index c388acc01..1545f4ced 100644 --- a/lib/multipart/multipart.go +++ b/lib/multipart/multipart.go @@ -17,7 +17,8 @@ import ( ) const ( - BufferSize = 1024 * 1024 // BufferSize is the default size of the pages used in the reader + // BufferSize is the default size of the pages used in the reader + BufferSize = 1024 * 1024 bufferCacheSize = 64 // max number of buffers to keep in cache bufferCacheFlushTime = 5 * time.Second // flush the cached buffers after this long )