package main

import (
	"fmt"
	"net/http"
)

func main() {
	links := []string{
		"https://google.com",
		"https://facebook.com",
		"https://golang.org",
		"https://stackoverflow.com",
		"https://shhsguushu.com",
	}
	c := make(chan string)

	for _, link := range links {
		go checklink(link, c)

	}
	for i := 0; i < len(links); i++ {
		fmt.Println(<-c)
	}

}

func checklink(link string, c chan string) {
	_, err := http.Get(link)
	if err != nil {
		fmt.Println(link, "might be down!")
		c <- " Yep, Its down!"
		return
	}
	fmt.Println(link, "is up")
	c <- " yep, Its up!"
}
