我在获取BOX API的访问令牌时遇到问题

 {re, err := ioutil.ReadAll(resp.Body)
    a := json.Unmarshal(re, &accessobj)}

Getting error like

error: invalid character '<' looking for beginning of value

The error

error: invalid character '<' looking for beginning of value

Means that json.Unmarshal() tried to parse the content you passed to it assuming json format but it found a '<' character where it shouldn't have. As suggested, your input is not in json format, most likely an HTML document.

Take a look at this code:

re := []byte("<html></html>")
var accessobj struct{ X string }
a := json.Unmarshal(re, &accessobj)

In this example the content is HTML. Try to run it (on Go Playground) and you get identical error message:

invalid character '<' looking for beginning of value