From 0ce9674c95f26d3e962377cbae4058384b4cf1d1 Mon Sep 17 00:00:00 2001 From: "Rose, William" Date: Wed, 22 Jan 2020 12:55:11 +1100 Subject: [PATCH] Adjust for Go 1.8-1.10 --- appveyor.yml | 2 ++ examples/azuread/azuread.go | 4 ++-- examples/tvp/tvp.go | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index c4d2bb06..51de3c26 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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 diff --git a/examples/azuread/azuread.go b/examples/azuread/azuread.go index 8bea6f35..cbcf9342 100644 --- a/examples/azuread/azuread.go +++ b/examples/azuread/azuread.go @@ -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) @@ -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) diff --git a/examples/tvp/tvp.go b/examples/tvp/tvp.go index a07bb652..eae614ef 100644 --- a/examples/tvp/tvp.go +++ b/examples/tvp/tvp.go @@ -1,3 +1,5 @@ +// +build go1.9 + package main import (