From 5de656ff04e345ea071ca64144d1d37412ecd49e Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 13:15:17 +0100 Subject: [PATCH] ax(mining): replace prose type comments with usage examples in mining_profile.go RawConfig and MiningProfile had description-style comments restating what the types are rather than showing how to use them (AX Principle 2 violation). Replaced with concrete call-site examples demonstrating real usage patterns. Co-Authored-By: Charon --- pkg/mining/mining_profile.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/mining/mining_profile.go b/pkg/mining/mining_profile.go index 731d829..f9226f7 100644 --- a/pkg/mining/mining_profile.go +++ b/pkg/mining/mining_profile.go @@ -1,13 +1,12 @@ package mining -// RawConfig is a raw encoded JSON value. -// It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. -// We define it as []byte (like json.RawMessage) to avoid swagger parsing issues with the json package. +// var raw RawConfig +// _ = json.Unmarshal([]byte(`{"pool":"pool.lthn.io:3333"}`), &raw) type RawConfig []byte -// MiningProfile represents a saved configuration for running a specific miner. -// It decouples the UI from the underlying miner's specific config structure. +// profile := MiningProfile{ID: "abc", Name: "LTHN RandomX", MinerType: "xmrig", Config: raw} +// manager.SaveProfile(profile) type MiningProfile struct { ID string `json:"id"` Name string `json:"name"`