Skip to content

Commit

Permalink
update readme examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mycrEEpy authored and svanharmelen committed Nov 13, 2023
1 parent a2fd184 commit ce857a2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ to list all projects for user "svanharmelen":

```go
git := gitlab.NewClient("yourtokengoeshere")
opt := &gitlab.ListProjectsOptions{Search: gitlab.String("svanharmelen")}
opt := &gitlab.ListProjectsOptions{Search: gitlab.Ptr("svanharmelen")}
projects, _, err := git.Projects.ListProjects(opt)
```

Expand All @@ -159,11 +159,11 @@ func main() {

// Create new project
p := &gitlab.CreateProjectOptions{
Name: gitlab.String("My Project"),
Description: gitlab.String("Just a test project to play with"),
MergeRequestsEnabled: gitlab.Bool(true),
SnippetsEnabled: gitlab.Bool(true),
Visibility: gitlab.Visibility(gitlab.PublicVisibility),
Name: gitlab.Ptr("My Project"),
Description: gitlab.Ptr("Just a test project to play with"),
MergeRequestsEnabled: gitlab.Ptr(true),
SnippetsEnabled: gitlab.Ptr(true),
Visibility: gitlab.Ptr(gitlab.PublicVisibility),
}
project, _, err := git.Projects.CreateProject(p)
if err != nil {
Expand All @@ -172,10 +172,10 @@ func main() {

// Add a new snippet
s := &gitlab.CreateProjectSnippetOptions{
Title: gitlab.String("Dummy Snippet"),
FileName: gitlab.String("snippet.go"),
Content: gitlab.String("package main...."),
Visibility: gitlab.Visibility(gitlab.PublicVisibility),
Title: gitlab.Ptr("Dummy Snippet"),
FileName: gitlab.Ptr("snippet.go"),
Content: gitlab.Ptr("package main...."),
Visibility: gitlab.Ptr(gitlab.PublicVisibility),
}
_, _, err = git.ProjectSnippets.CreateSnippet(project.ID, s)
if err != nil {
Expand Down

0 comments on commit ce857a2

Please sign in to comment.