github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/kbfs/kbfsedits/read.go (about) 1 // Copyright 2018 Keybase Inc. All rights reserved. 2 // Use of this source code is governed by a BSD 3 // license that can be found in the LICENSE file. 4 5 package kbfsedits 6 7 import "encoding/json" 8 9 // ReadSelfWrite converts the given message string into the 10 // SelfWriteMessage type, if possible. 11 func ReadSelfWrite(msg string) (ret SelfWriteMessage, err error) { 12 err = json.Unmarshal([]byte(msg), &ret) 13 if err != nil { 14 return SelfWriteMessage{}, err 15 } 16 return ret, nil 17 }