File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed
articles/cognitive-services/Computer-vision/QuickStarts Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -46,28 +46,23 @@ import (
46
46
" fmt"
47
47
" io/ioutil"
48
48
" net/http"
49
+ " os"
49
50
" strings"
50
51
" time"
51
52
)
52
53
53
54
func main () {
55
+ // Add your Computer Vision subscription key and endpoint to your environment variables.
54
56
// Add your Computer Vision subscription key and endpoint to your environment variables.
55
57
subscriptionKey := os.Getenv (" COMPUTER_VISION_SUBSCRIPTION_KEY" )
56
- if (subscriptionKey == " " ) {
57
- log.Fatal (" \n\n Set the COMPUTER_VISION_SUBSCRIPTION_KEY environment variable.\n " +
58
- " **Restart your shell or IDE for changes to take effect.**\n " )
59
-
60
58
endpoint := os.Getenv (" COMPUTER_VISION_ENDPOINT" )
61
- if (" " == endpoint) {
62
- log.Fatal (" \n\n Set 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"
66
61
const imageUrl = " https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/" +
67
62
" Atomist_quote_from_Democritus.png/338px-Atomist_quote_from_Democritus.png"
68
63
69
- const params = " ?language=unk&detectOrientation=true"
70
- const uri = uriBase + params
64
+ params : = " ?language=unk&detectOrientation=true"
65
+ uri : = uriBase + params
71
66
const imageUrlEnc = " {\" url\" :\" " + imageUrl + " \" }"
72
67
73
68
reader := strings.NewReader (imageUrlEnc)
You can’t perform that action at this time.
0 commit comments