MCPcopy Create free account
hub / github.com/cli/cli / IsInternalPort

Function IsInternalPort

internal/codespaces/portforwarder/port_forwarder.go:404–412  ·  view source on GitHub ↗

IsInternalPort returns true if the port is internal.

(port *tunnels.TunnelPort)

Source from the content-addressed store, hash-verified

402
403// IsInternalPort returns true if the port is internal.
404func IsInternalPort(port *tunnels.TunnelPort) bool {
405 for _, label := range port.Labels {
406 if strings.EqualFold(label, InternalPortLabel) {
407 return true
408 }
409 }
410
411 return false
412}
413
414// convertIntToUint16 converts the given int to a uint16.
415func convertIntToUint16(port int) (uint16, error) {

Callers 2

ListPortsMethod · 0.92
TestIsInternalPortFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestIsInternalPortFunction · 0.68