2
0

data.go 949 B

1234567891011121314151617181920212223242526
  1. // Copyright © 2021 Ettore Di Giacinto <[email protected]>
  2. //
  3. // This program is free software; you can redistribute it and/or modify
  4. // it under the terms of the GNU General Public License as published by
  5. // the Free Software Foundation; either version 2 of the License, or
  6. // (at your option) any later version.
  7. //
  8. // This program is distributed in the hope that it will be useful,
  9. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. // GNU General Public License for more details.
  12. //
  13. // You should have received a copy of the GNU General Public License along
  14. // with this program; if not, see <http://www.gnu.org/licenses/>.
  15. package blockchain
  16. import "encoding/json"
  17. type Data string
  18. // Unmarshal the result into the interface. Use it to retrieve data
  19. // set with SetValue
  20. func (d Data) Unmarshal(i interface{}) error {
  21. return json.Unmarshal([]byte(d), i)
  22. }