This is an automated email from the ASF dual-hosted git repository.

sjanc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newtmgr.git

commit f5be3928ba3e4f88808d43bdb4e84a7d35bb6a06
Author: Szymon Janc <[email protected]>
AuthorDate: Wed Oct 21 23:22:38 2026 +0200

    nmxact/nmble: Remove unreachable return in BleBytes.MarshalJSON
    
    The function returned json.Marshal(s) followed by a leftover
    "return buf.Bytes(), nil" that could never execute. That dead path
    would also have produced invalid JSON (an unquoted 0x01:0x02 string)
    which UnmarshalJSON could not parse, so the reachable path is the
    correct one. Drop the dead statement and the temporary variable.
    
    Assisted-by: Claude:claude-opus-5-5
---
 nmxact/nmble/ble_proto.go | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/nmxact/nmble/ble_proto.go b/nmxact/nmble/ble_proto.go
index ebcae93..37243ae 100644
--- a/nmxact/nmble/ble_proto.go
+++ b/nmxact/nmble/ble_proto.go
@@ -1606,10 +1606,7 @@ func (bb *BleBytes) MarshalJSON() ([]byte, error) {
                fmt.Fprintf(&buf, "0x%02x", b)
        }
 
-       s := buf.String()
-       return json.Marshal(s)
-
-       return buf.Bytes(), nil
+       return json.Marshal(buf.String())
 }
 
 func (bb *BleBytes) UnmarshalJSON(data []byte) error {

Reply via email to