forked from TrueCloudLab/neoneo-go
adab83496c
It's absolutely irrelevant for the client and request/response packages should only contain code that is useful on both sides of the conversation. It's OK for client tests to reuse this code, but the package is used by external developers and they shouldn't be bothered with it. Nothing changed functionally here except WSClient simplification. Fixes #2236.
22 lines
345 B
Go
22 lines
345 B
Go
package params
|
|
|
|
import "fmt"
|
|
|
|
type (
|
|
// Params represents the JSON-RPC params.
|
|
Params []Param
|
|
)
|
|
|
|
// Value returns the param struct for the given
|
|
// index if it exists.
|
|
func (p Params) Value(index int) *Param {
|
|
if len(p) > index {
|
|
return &p[index]
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (p Params) String() string {
|
|
return fmt.Sprintf("%v", []Param(p))
|
|
}
|