Skip to content

Commit 93e66cd

Browse files
authored
Update go-print-text.md
1 parent 0b6db20 commit 93e66cd

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

articles/cognitive-services/Computer-vision/QuickStarts/go-print-text.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,28 +46,23 @@ import (
4646
"fmt"
4747
"io/ioutil"
4848
"net/http"
49+
"os"
4950
"strings"
5051
"time"
5152
)
5253

5354
func main() {
55+
// Add your Computer Vision subscription key and endpoint to your environment variables.
5456
// Add your Computer Vision subscription key and endpoint to your environment variables.
5557
subscriptionKey := os.Getenv("COMPUTER_VISION_SUBSCRIPTION_KEY")
56-
if (subscriptionKey == "") {
57-
log.Fatal("\n\nSet the COMPUTER_VISION_SUBSCRIPTION_KEY environment variable.\n" +
58-
"**Restart your shell or IDE for changes to take effect.**\n")
59-
6058
endpoint := os.Getenv("COMPUTER_VISION_ENDPOINT")
61-
if ("" == endpoint) {
62-
log.Fatal("\n\nSet the COMPUTER_VISION_ENDPOINT environment variable.\n" +
63-
"**Restart your shell or IDE for changes to take effect.**")
64-
}
65-
const uriBase = endpoint + "vision/v2.1/ocr"
59+
60+
uriBase := endpoint + "vision/v3.0/ocr"
6661
const imageUrl = "https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/" +
6762
"Atomist_quote_from_Democritus.png/338px-Atomist_quote_from_Democritus.png"
6863

69-
const params = "?language=unk&detectOrientation=true"
70-
const uri = uriBase + params
64+
params := "?language=unk&detectOrientation=true"
65+
uri := uriBase + params
7166
const imageUrlEnc = "{\"url\":\"" + imageUrl + "\"}"
7267

7368
reader := strings.NewReader(imageUrlEnc)

0 commit comments

Comments
 (0)