<commit_before>package cli

import (
	"encoding/json"
	"errors"
	log "github.com/Sirupsen/logrus"
	"github.com/bitrise-io/bitrise-cli/models"
	"github.com/codegangsta/cli"
	"os"
)

func doInit(c *cli.Context) {
	log.Info("[BITRISE_CLI] - Init -- Work-in-progress!")
	workflowModel := models.WorkflowModel{
		FormatVersion: "0.9.0",
		Environments:  []string{},
		Steps:         []models.StepModel{},
	}
	SaveToFile("./bitrise.json", workflowModel)
	os.Exit(1)
}

func SaveToFile(pth string, workflowModel models.WorkflowModel) error {
	if pth == "" {
		return errors.New("No path provided")
	}

	if file, err := os.Create(pth); err != nil {
		return err
	} else {
		defer file.Close()

		if jsonContBytes, err := GenerateNonFormattedJSON(workflowModel); err != nil {
			return err
		} else if _, err := file.Write(jsonContBytes); err != nil {
			return err
		}
		return nil
	}
}

func GenerateNonFormattedJSON(v interface{}) ([]byte, error) {
	jsonContBytes, err := json.Marshal(v)
	if err != nil {
		return []byte{}, err
	}
	return jsonContBytes, nil
}
<commit_msg>go fmt<commit_after>package cli

import (
	"encoding/json"
	"errors"
	"os"

	log "github.com/Sirupsen/logrus"
	"github.com/bitrise-io/bitrise-cli/models"
	"github.com/codegangsta/cli"
)

func doInit(c *cli.Context) {
	log.Info("[BITRISE_CLI] - Init -- Work-in-progress!")
	workflowModel := models.WorkflowModel{
		FormatVersion: "0.9.0",
		Environments:  []string{},
		Steps:         []models.StepModel{},
	}
	SaveToFile("./bitrise.json", workflowModel)
	os.Exit(1)
}

func SaveToFile(pth string, workflowModel models.WorkflowModel) error {
	if pth == "" {
		return errors.New("No path provided")
	}

	if file, err := os.Create(pth); err != nil {
		return err
	} else {
		defer file.Close()

		if jsonContBytes, err := GenerateNonFormattedJSON(workflowModel); err != nil {
			return err
		} else if _, err := file.Write(jsonContBytes); err != nil {
			return err
		}
		return nil
	}
}

func GenerateNonFormattedJSON(v interface{}) ([]byte, error) {
	jsonContBytes, err := json.Marshal(v)
	if err != nil {
		return []byte{}, err
	}
	return jsonContBytes, nil
}

{'fraction_non_alphanumeric': 0.15522107243650046, 'fraction_numerical': 0.0037629350893697085, 'mean_word_length': 3.8672768878718538, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '2168213', 'n_tokens_mistral': 825, 'n_tokens_neox': 785, 'n_words': 171}