Skip to content

Commit

Permalink
Add Go syntax highlighting to README
Browse files Browse the repository at this point in the history
  • Loading branch information
arthrarnld authored and ncw committed Aug 7, 2018
1 parent b2a7479 commit bd8b704
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions README.md
Expand Up @@ -26,26 +26,27 @@ See here for full package docs
- http://godoc.org/github.com/ncw/swift

Here is a short example from the docs

import "github.com/ncw/swift"

// Create a connection
c := swift.Connection{
UserName: "user",
ApiKey: "key",
AuthUrl: "auth_url",
Domain: "domain", // Name of the domain (v3 auth only)
Tenant: "tenant", // Name of the tenant (v2 auth only)
}
// Authenticate
err := c.Authenticate()
if err != nil {
panic(err)
}
// List all the containers
containers, err := c.ContainerNames(nil)
fmt.Println(containers)
// etc...
```go
import "github.com/ncw/swift"

// Create a connection
c := swift.Connection{
UserName: "user",
ApiKey: "key",
AuthUrl: "auth_url",
Domain: "domain", // Name of the domain (v3 auth only)
Tenant: "tenant", // Name of the tenant (v2 auth only)
}
// Authenticate
err := c.Authenticate()
if err != nil {
panic(err)
}
// List all the containers
containers, err := c.ContainerNames(nil)
fmt.Println(containers)
// etc...
```

Additions
---------
Expand Down

0 comments on commit bd8b704

Please sign in to comment.