Let’s understand how to get IP and Hostname in Golang!

In Golang we’ll make use of the internal library called ‘os’ to get the hostname and to get the IP address we’ll use ‘net’ as shown in the code snippet.

In Java, we’ll make use of ‘java.net.InetAddress’ to get the Ip address and Hostname as shown in the code snippet.

Thanks for reading! A few (hopefully 50) claps? are always appreciated. Follow me and share this article if you like it.

--

--

In this blog post, we’ll see how to use the time package in Golang. The package time feature allows us to measure and display time.

To use the time package in Golang, we need to import the package.

import "time"

In this code snippets ypu will be avle to see the implementation for Seconds, Milliseconds, Nanoseconds, Microseconds, Minutes, CurrentTime, Date with various format.

Thanks for reading! A few (hopefully 50) claps? are always appreciated. Follow me and share this article if you like it.

--

--

Yash Chauhan

Yash Chauhan

Software Engineer @Altair Engineering | Exploring Golang & Reactjs