This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static void main(String[] args) { | |
| // Code here.. | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Ano { | |
| public static void main(String[] args) { | |
| System.out.println("Loosu AK"); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package utils | |
| import ( | |
| "fmt" | |
| "log" | |
| "os" | |
| "path/filepath" | |
| ) | |
| // GeneralLogger exported |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| generalLog, err := os.OpenFile(absPath+"/general-log.txt", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| GeneralLogger = log.New(generalLog, "General Logger:\t", log.Ldate|log.Ltime|log.Lshortfile) | |
| ErrorLogger = log.New(generalLog, "Error Logger:\t", log.Ldate|log.Ltime|log.Lshortfile) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| u "go-logger/src/utils" | |
| ) | |
| func main() { | |
| // Strting the Application | |
| u.GeneralLogger.Println("Starting..") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func Download(url string, filename string, timeout int64) *u.ErrorResponse { | |
| u.GeneralLogger.Println("Downloading", url, "...") | |
| client := http.Client{ | |
| Timeout: time.Duration(timeout * int64(time.Second)), | |
| } | |
| resp, err := client.Get(url) | |
| if err != nil { | |
| u.ErrorLogger.Println("Cannot download file from the given url", err) | |
| return u.ReturnErrorResponse(err, "Cannot download file from the given url") | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func WriteLanguageFiles(csvFilePath string) *u.ErrorResponse { | |
| csvFile, err := os.Open(csvFilePath) | |
| if err != nil { | |
| u.ErrorLogger.Println("Cannot open file:"+csvFilePath, err) | |
| return u.ReturnErrorResponse(err, "Cannot open file:"+csvFilePath) | |
| } | |
| csvFileContent, err := csv.NewReader(csvFile).ReadAll() | |
| for i, lang := range csvFileContent[0][1:] { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package utils | |
| import ( | |
| "fmt" | |
| "log" | |
| "os" | |
| "path/filepath" | |
| ) | |
| // ErrorResponse exported |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package services | |
| import ( | |
| "encoding/csv" | |
| "encoding/json" | |
| "errors" | |
| u "gsheet-to-json-csv/src/utils" | |
| "io/ioutil" | |
| "net/http" | |
| "os" |
OlderNewer