Remove dead code

This commit is contained in:
2021-03-22 00:00:11 +01:00
parent aa888f0fee
commit 5ef2968abb

View File

@@ -1,36 +0,0 @@
package gcp
import (
"fmt"
"io/ioutil"
"net/http"
"strings"
"time"
)
func getAddress() string {
var c = &http.Client{
Timeout: time.Second * 5,
}
resp, err := c.Get("https://atto.run/ip")
if err != nil {
// handle error
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
return string(body)
}
func (c *ComputeClient) getFirewallRules() error {
a, err := c.Firewalls.Get(c.Project, "morning-mgmt-to-backend").Do()
if err != nil {
return err
}
b := getAddress()
for _, r := range a.SourceRanges {
if strings.HasPrefix(r, b) {
fmt.Println(r)
}
}
return nil
}