networking - Golang - check if IP address is in a network -


given:

  • a network address a: (172.17.0.0/16)
  • and ip address host b: (172.17.0.2/16)

how can if b in a?

all addresses string variables in following form: [ip address in dot-decimal notation]/[subnet mask]. should try manipulating strings (initial thoughts). there different path?

here same question python: "how can check if ip in network in python". approach go: go/golang check ip address in range

the go net package includes following functions:

this should cover needs.


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -