Commit a0d725ef authored by Addshore's avatar Addshore 🏄
Browse files

Run gofmt -s, as Go report card wants it

parent 1ce4c31b
......@@ -101,4 +101,4 @@ func (f DotFile) Missing(name string) bool {
/*List all values from the env*/
func (f DotFile) List() map[string]string {
return f.read()
}
\ No newline at end of file
}
......@@ -30,4 +30,4 @@ func filter(ss []string, test func(string) bool) (ret []string) {
}
}
return
}
\ No newline at end of file
}
......@@ -10,7 +10,7 @@ import (
/*EnsureInMemoryFilesAreOnDisk makes sure that up to date copies of our in app docker-compose files are on disk
TODO this should be called only when we update the bin?
TODO This is way to complex, and should be more clever.. checking a hash or something? and be more lightweight*/
func ensureInMemoryFilesAreOnDisk( projectDirectory string ) {
func ensureInMemoryFilesAreOnDisk(projectDirectory string) {
packagedFiles := packagedFileNames()
// Ensure each file is on disk and up to date
......@@ -24,7 +24,7 @@ func ensureInMemoryFilesAreOnDisk( projectDirectory string ) {
writeBytesToDisk(packagedBytes, fileTargetOnDisk)
} else {
onDiskBytes := diskFileToBytes(fileTargetOnDisk)
if(!bytes.Equal(onDiskBytes, packagedBytes)) {
if !bytes.Equal(onDiskBytes, packagedBytes) {
// TODO only output the below line with verbose logging
//fmt.Println(fileTargetOnDisk + " out of date, so writing...")
writeBytesToDisk(packagedBytes, fileTargetOnDisk)
......@@ -39,7 +39,7 @@ func diskFileToBytes(file string) []byte {
return bytes
}
func getAssumedFilePerms( filePath string ) os.FileMode {
func getAssumedFilePerms(filePath string) os.FileMode {
// Set all .sh files as +x when creating them
// All users should be able to read and execute these files so users in containers can use them
// XXX: Currently if you change these file permissions on disk files will need to be deleted and re added..
......@@ -49,7 +49,7 @@ func getAssumedFilePerms( filePath string ) os.FileMode {
return 0655
}
func writeBytesToDisk( bytes []byte, filePath string ) {
func writeBytesToDisk(bytes []byte, filePath string) {
ensureDirectoryForFileOnDisk(filePath)
ioutil.WriteFile(filePath, bytes, getAssumedFilePerms(filePath))
// TODO check error?
......@@ -63,4 +63,4 @@ func ensureDirectoryOnDisk(dirPath string) {
if _, err := os.Stat(dirPath); err != nil {
os.MkdirAll(dirPath, 0755)
}
}
\ No newline at end of file
}
......@@ -23,8 +23,8 @@ import (
)
/*EnsureReady makes sure that the files component is ready*/
func EnsureReady( projectDirectory string ) {
ensureInMemoryFilesAreOnDisk( projectDirectory );
func EnsureReady(projectDirectory string) {
ensureInMemoryFilesAreOnDisk(projectDirectory)
}
/*ListRawDcYamlFilesInContextOfProjectDirectory ...*/
......@@ -33,7 +33,7 @@ func ListRawDcYamlFilesInContextOfProjectDirectory(projectDirectory string) []st
var files []string
for _, file := range listRawFiles(projectDirectory) {
if( filepath.Ext(file) == ".yml" ) {
if filepath.Ext(file) == ".yml" {
files = append(files, filepath.Base(file))
}
}
......@@ -46,7 +46,7 @@ func listRawFiles(projectDirectory string) []string {
var files []string
err := filepath.Walk(projectDirectory, func(path string, info os.FileInfo, err error) error {
if(! info.IsDir()){
if !info.IsDir() {
files = append(files, path)
}
return nil
......@@ -55,4 +55,4 @@ func listRawFiles(projectDirectory string) []string {
panic(err)
}
return files
}
\ No newline at end of file
}
......@@ -22,14 +22,19 @@ import "gerrit.wikimedia.org/r/mediawiki/tools/cli/cmd"
/*GitCommit holds short commit hash of source tree*/
var GitCommit string
/*GitBranch holds current branch name the code is built off*/
var GitBranch string
/*GitState shows whether there are uncommitted changes*/
var GitState string
/*GitSummary holds output of git describe --tags --dirty --always*/
var GitSummary string
/*BuildDate holds RFC3339 formatted UTC date (build time)*/
var BuildDate string
/*Version holds contents of ./VERSION file, if exists, or the value passed via the -version option*/
var Version string
......
......@@ -5,4 +5,4 @@ package tools
import (
_ "bou.ke/staticfiles"
_ "github.com/ahmetb/govvv"
)
\ No newline at end of file
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment