Skip to content
Sections
>> Trisquel >> Pakete >> nabia >> devel >> golang-github-alecthomas-repr-dev
etiona  ] [  nabia  ] [  aramo  ]
[ Quellcode: golang-github-alecthomas-repr  ]

Paket: golang-github-alecthomas-repr-dev (0.0~git20181024.d37bc2a-2)

Python's repr() for Go

The repr package attempts to represent Go values in a form that can be used almost directly in Go source code.

Unfortunately, some values (such as pointers to basic types) cannot be represented directly in Go. These values will be represented as &<value>, e.g. &23

Example:

  type test struct {
    S string
    I int
    A []int
  }

  func main() {
    repr.Print(&test{
      S: "String",
      I: 123,
      A: []int{1, 2, 3},
    })
  }

Outputs

  &main.test{S: "String", I: 123, A: []int{1, 2, 3}}

Andere Pakete mit Bezug zu golang-github-alecthomas-repr-dev

  • hängt ab von
  • empfiehlt
  • schlägt vor

golang-github-alecthomas-repr-dev herunterladen

Download für alle verfügbaren Architekturen
Architektur Paketgröße Größe (installiert) Dateien
all 6,0 kB26 kB [Liste der Dateien]