Skip to main content
Bumped by Community user
Bumped by Community user
deleted 20 characters in body
Source Link
Evan Carroll
  • 2.6k
  • 6
  • 33
  • 81

You can set up the test container to inspect with this,

$ podman run -d -p 1234:1234 --name evanrox alpine:3 sleep 360

When I run the following I get foo { 1234} however I want foo 1234 (no curly brackets, no spaces). How can I get this with podman/go?

$ podman inspect evanrox --format 'foo '{{index .NetworkSettings.Ports "1234/tcp" 0 }}'
foo { 1234}

Again, I just want "foo 1234""1234"

You can set up the test container to inspect with this,

$ podman run -d -p 1234:1234 --name evanrox alpine:3 sleep 360

When I run the following I get foo { 1234} however I want foo 1234 (no curly brackets, no spaces). How can I get this with podman/go?

$ podman inspect evanrox --format 'foo {{index .NetworkSettings.Ports "1234/tcp" 0 }}'
foo { 1234}

Again, I just want "foo 1234"

You can set up the test container to inspect with this,

$ podman run -d -p 1234:1234 --name evanrox alpine:3 sleep 360

When I run the following I get { 1234} however I want 1234 (no curly brackets, no spaces). How can I get this with podman/go?

$ podman inspect evanrox --format '{{index .NetworkSettings.Ports "1234/tcp" 0 }}'
{ 1234}

Again, I just want "1234"

added 2 characters in body
Source Link
Evan Carroll
  • 2.6k
  • 6
  • 33
  • 81

You can set up the test container to inspect with this,

$ podman run -d -p 1234:1234 --name evanrox alpine:3 sleep 360

When I run the following I get foo { 1234} however I want foo 1234 (no curly brackets, no spaces). How can I get this with podman/go?

$ podman inspect evanrox --format 'foo {{index .NetworkSettings.Ports "1234/tcp" 0 }}'
foo { 1234}

Again, I just want "foo 1234"

You can set up the test container to inspect with this,

podman run -d -p 1234:1234 --name evanrox alpine:3 sleep 360

When I run the following I get foo { 1234} however I want foo 1234 (no curly brackets, no spaces). How can I get this with podman/go?

$ podman inspect evanrox --format 'foo {{index .NetworkSettings.Ports "1234/tcp" 0 }}'
foo { 1234}

Again, I just want "foo 1234"

You can set up the test container to inspect with this,

$ podman run -d -p 1234:1234 --name evanrox alpine:3 sleep 360

When I run the following I get foo { 1234} however I want foo 1234 (no curly brackets, no spaces). How can I get this with podman/go?

$ podman inspect evanrox --format 'foo {{index .NetworkSettings.Ports "1234/tcp" 0 }}'
foo { 1234}

Again, I just want "foo 1234"

deleted 35 characters in body
Source Link
Evan Carroll
  • 2.6k
  • 6
  • 33
  • 81

Go format string has produces curly brackets around text value?

You can set up the test container to inspect with this,

podman run -d -p 1234:1234 --name evanrox alpine:3 sleep 360

When I run the following I get foo { 417551234} however I want 41755foo 1234 (no curly brackets, no spaces). How can I get this with podman/go?

$ podman inspect foo-webevanrox --format 'Foo is currently running at'foo {{index (index .NetworkSettings.Ports  "9999"1234/tcp") 0 }}'
Stash is currently running atfoo { 417551234}

Again, I get the same thing withjust want "foo 1234"

--format '{{ $port := index (index .NetworkSettings.Ports "9999/tcp") 0 -}} Foo is currently running at {{ $port }}'

Go format string has produces curly brackets around text value?

When I run the following I get { 41755} however I want 41755 (no curly brackets, no spaces). How can I get this with podman/go?

$ podman inspect foo-web --format 'Foo is currently running at {{index (index .NetworkSettings.Ports  "9999/tcp") 0}}'
Stash is currently running at { 41755}

I get the same thing with

--format '{{ $port := index (index .NetworkSettings.Ports "9999/tcp") 0 -}} Foo is currently running at {{ $port }}'

Go format string produces curly brackets around text value?

You can set up the test container to inspect with this,

podman run -d -p 1234:1234 --name evanrox alpine:3 sleep 360

When I run the following I get foo { 1234} however I want foo 1234 (no curly brackets, no spaces). How can I get this with podman/go?

$ podman inspect evanrox --format 'foo {{index .NetworkSettings.Ports "1234/tcp" 0 }}'
foo { 1234}

Again, I just want "foo 1234"

added 185 characters in body
Source Link
Evan Carroll
  • 2.6k
  • 6
  • 33
  • 81
Loading
Source Link
Evan Carroll
  • 2.6k
  • 6
  • 33
  • 81
Loading