Golang未使用的类型(但已使用)

The following struct gives the warning:

Unused type 'Device_Type_Struct

type Device_Type_Struct struct {
    Id              string              `json:"_id"`
    BrandName       string              `json:"brandName"`
    Category        string              `json:"category"`
    Firmware        string              `json:"firmware"`
    Label           string              `json:"label,omitempty"`
    Model           string              `json:"model"`
    Supported       bool                `json:"supported"`
    Type            string              `json:"type"`
    Platform        string              `json:"platform,omitempty"`
    OvrcPro         bool                `json:"ovrcPro"`
    OvrcHome        bool                `json:"ovrcHome"`
    LogTimeSeries   bool                `json:"logTimeSeries"`
    Attributes      Attributes_Struct   `json:"attributes"`
}

However, it is used:

var deviceType Device_Type_Struct
err = json.Unmarshal(buf, &deviceType)
if err == nil {
    println("Request unmarshalled")
} else {
    println("Error unmarshalling request to Device_Type_Struct")
}

insertedId, err := db.UpsertOne("devicetypes", deviceType)
if err != nil {
    println("Error upserting document")
    success = false
}

Is there any reason for this or is it just an IDE error?

It was simply an IDE error. After I restarted my laptop, GoLand no longer displayed any errors.