Sample code for 30+ languages & platforms
Go Requires Chilkat v11.0.0+

Transition from Imap.ThreadCmd to Imap.QueryThread

Provides instructions for replacing deprecated ThreadCmd method calls with QueryThread.

Chilkat Go Downloads

Go
    success := false

    imap := chilkat.NewImap()

    //  ...
    //  ...

    threadAlg := "REFERENCES"
    charset := "UTF-8"
    searchCriteria := "SUBJECT a"
    bUid := true

    //  ------------------------------------------------------------------------
    //  The ThreadCmd method is deprecated:

    jsonObj := imap.ThreadCmd(threadAlg,charset,searchCriteria,bUid)
    if imap.LastMethodSuccess() == false {
        fmt.Println(imap.LastErrorText())
        imap.DisposeImap()
        return
    }

    //  ...
    //  ...

    jsonObj.DisposeJsonObject()

    //  ------------------------------------------------------------------------
    //  Do the equivalent using QueryThread.
    //  Your application creates a new, empty JsonObject object which is passed 
    //  in the last argument and filled upon success.

    imap.SetSearchCharset("UTF-8")

    json := chilkat.NewJsonObject()
    success = imap.QueryThread(threadAlg,searchCriteria,bUid,json)
    if success == false {
        fmt.Println(imap.LastErrorText())
        imap.DisposeImap()
        json.DisposeJsonObject()
        return
    }


    imap.DisposeImap()
    json.DisposeJsonObject()