<commit_before>package main

import (
	"encoding/json"
	"flag"
	"log"
	"net/http"
	"os"
	"time"
)

var configFile = flag.String("config", "", "path to configuration file") 

// Config represents a JSON config file ~/.config/onetimedns.
type Config struct {
	Name, Secret string
}

// Record describes the JSON data we get back from the OneTimeDNS server.
type Record struct {
	Expires int
	Address string `json:"record"`
	Status string
	Value string
}

func (r *Record) Get(url string) error {
	resp, err := http.Get(url)
	if err != nil {
		return err
	}

	dec := json.NewDecoder(resp.Body)
	if err = dec.Decode(r); err != nil {
		return err
	}
	resp.Body.Close()
	return nil
}

func main() {
	flag.Parse()
	if len(*configFile) == 0 {
		home := os.Getenv("HOME")
		*configFile = home + "/.config/onetimedns"
	}

	file, err := os.Open(*configFile)
	if err != nil {
		log.Fatalln(err)
	}

	dec := json.NewDecoder(file)
	var c Config
	if err = dec.Decode(&c); err != nil {
		log.Fatalln(err)
	}
	url := "https://onetimedns.net/set?name=" + c.Name + "&secret=" + c.Secret

	// We should not to fail after this point.

	r := new(Record)
	tick := time.Tick(10 * time.Minute)
	for _ = range tick {
    	err = r.Get(url)
		if err != nil {
			log.Println(err)
		} else {
			log.Println(r.Address)
		}
	}
}<commit_msg>gofmt.<commit_after>package main

import (
	"encoding/json"
	"flag"
	"log"
	"net/http"
	"os"
	"time"
)

var configFile = flag.String("config", "", "path to configuration file")

// Config represents a JSON config file ~/.config/onetimedns.
type Config struct {
	Name, Secret string
}

// Record describes the JSON data we get back from the OneTimeDNS server.
type Record struct {
	Expires int
	Address string `json:"record"`
	Status  string
	Value   string
}

func (r *Record) Get(url string) error {
	resp, err := http.Get(url)
	if err != nil {
		return err
	}

	dec := json.NewDecoder(resp.Body)
	if err = dec.Decode(r); err != nil {
		return err
	}
	resp.Body.Close()
	return nil
}

func main() {
	flag.Parse()
	if len(*configFile) == 0 {
		home := os.Getenv("HOME")
		*configFile = home + "/.config/onetimedns"
	}

	file, err := os.Open(*configFile)
	if err != nil {
		log.Fatalln(err)
	}

	dec := json.NewDecoder(file)
	var c Config
	if err = dec.Decode(&c); err != nil {
		log.Fatalln(err)
	}
	url := "https://onetimedns.net/set?name=" + c.Name + "&secret=" + c.Secret

	// We should not to fail after this point.

	r := new(Record)
	tick := time.Tick(10 * time.Minute)
	for _ = range tick {
		err = r.Get(url)
		if err != nil {
			log.Println(err)
		} else {
			log.Println(r.Address)
		}
	}
}
{'fraction_non_alphanumeric': 0.15529141104294478, 'fraction_numerical': 0.0023006134969325155, 'mean_word_length': 3.187800963081862, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '25563', 'n_tokens_mistral': 1040, 'n_tokens_neox': 990, 'n_words': 274}