Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
go-gitlab
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
go-gitlab
Commits
d2ef590f
Commit
d2ef590f
authored
Dec 12, 2017
by
Sander van Harmelen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure GetRawFile returns []byte
parent
0f869110
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
project_snippets.go
project_snippets.go
+1
-1
repository_files.go
repository_files.go
+5
-4
No files found.
project_snippets.go
View file @
d2ef590f
...
...
@@ -30,7 +30,7 @@ type ProjectSnippetsService struct {
client
*
Client
}
// ListSnippetsOptions represents the available ListSnippets() options.
// List
Project
SnippetsOptions represents the available ListSnippets() options.
//
// GitLab API docs: https://docs.gitlab.com/ce/api/project_snippets.html#list-snippets
type
ListProjectSnippetsOptions
struct
{
...
...
repository_files.go
View file @
d2ef590f
...
...
@@ -17,6 +17,7 @@
package
gitlab
import
(
"bytes"
"fmt"
"net/url"
)
...
...
@@ -93,7 +94,7 @@ type GetRawFileOptions struct {
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/repository_files.html#get-raw-file-from-repository
func
(
s
*
RepositoryFilesService
)
GetRawFile
(
pid
interface
{},
fileName
string
,
opt
*
GetRawFileOptions
,
options
...
OptionFunc
)
(
*
Fil
e
,
*
Response
,
error
)
{
func
(
s
*
RepositoryFilesService
)
GetRawFile
(
pid
interface
{},
fileName
string
,
opt
*
GetRawFileOptions
,
options
...
OptionFunc
)
(
[]
byt
e
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
...
...
@@ -105,13 +106,13 @@ func (s *RepositoryFilesService) GetRawFile(pid interface{}, fileName string, op
return
nil
,
nil
,
err
}
f
:=
new
(
File
)
resp
,
err
:=
s
.
client
.
Do
(
req
,
f
)
var
f
bytes
.
Buffer
resp
,
err
:=
s
.
client
.
Do
(
req
,
&
f
)
if
err
!=
nil
{
return
nil
,
resp
,
err
}
return
f
,
resp
,
err
return
f
.
Bytes
()
,
resp
,
err
}
// FileInfo represents file details of a GitLab repository file.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment