The Set method is implemented as blind upsert and does not return any indication of what value, if any, previously existed for the key in question. Callers that wish to leave any existing value intact, or save or report it elsewhere after it is overwritten, must first perform a Get or Has in order to establish if one exists. Set could instead return an indication of whether the key previously existed.
See discussion about this for the HAMT in filecoin-project/go-hamt-ipld#75.