Skip to content

Commit

Permalink
Adjust for Go 1.8-1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
wrosenuance committed Jan 22, 2020
1 parent de96231 commit 0ce9674
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ install:
- go version
- go env
- go get -u github.com/golang-sql/civil
- go get -u golang.org/x/crypto/pkcs12
- go get -u github.com/Azure/go-autorest/autorest/adal

build_script:
- go build
Expand Down
4 changes: 2 additions & 2 deletions examples/azuread/azuread.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func createDatabaseIfNotExists() error {
return err
}

quoted := strings.ReplaceAll(*database, "]", "]]")
quoted := strings.Replace(*database, "]", "]]", -1)
sql := "IF NOT EXISTS (SELECT 1 FROM sys.databases WHERE name = @p1)\n CREATE DATABASE [" + quoted + "] ( SERVICE_OBJECTIVE = 'S0' )"
log.Printf("Exec: @p1 = '%s'\n%s\n", *database, sql)
_, err = conn.Exec(sql, *database)
Expand Down Expand Up @@ -98,7 +98,7 @@ func addExternalUserIfNotExists(user string) error {

defer conn.Close()

quoted := strings.ReplaceAll(user, "]", "]]")
quoted := strings.Replace(user, "]", "]]", -1)
sql := "IF NOT EXISTS (SELECT 1 FROM sys.database_principals WHERE name = @p1)\n CREATE USER [" + quoted + "] FROM EXTERNAL PROVIDER"
log.Printf("Exec: @p1 = '%s'\n%s\n", user, sql)
_, err = conn.Exec(sql, user)
Expand Down
2 changes: 2 additions & 0 deletions examples/tvp/tvp.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build go1.9

package main

import (
Expand Down

0 comments on commit 0ce9674

Please sign in to comment.