Replace prazdnikisegodnyaru with celebratoday, small underhood fixes
- Replace prazdnikisegodnyaru with celebratoday as first is banned in Russia - Update .golangci.yml rule set - Megatons of fixes for linter - Update README.md
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// Implements aleesa-web-go application.
|
||||
package main
|
||||
|
||||
import (
|
||||
|
||||
44
cmd/celebratoday_test/main.go
Normal file
44
cmd/celebratoday_test/main.go
Normal file
@@ -0,0 +1,44 @@
|
||||
// Package main implements celebratoday api test.
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"aleesa-webapp-go/internal/celebratoday"
|
||||
"aleesa-webapp-go/internal/log"
|
||||
"aleesa-webapp-go/internal/webapp"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var (
|
||||
logfile *os.File
|
||||
)
|
||||
|
||||
err := webapp.ReadConfig()
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Unable to parse config: %s", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// Откроем лог и скормим его логгеру.
|
||||
if webapp.Config.Log != "" {
|
||||
logfile, err = os.OpenFile(webapp.Config.Log, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
|
||||
|
||||
if err != nil {
|
||||
log.Errorf("Unable to open log file %s: %s", webapp.Config.Log, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
log.Init(webapp.Config.Loglevel, logfile)
|
||||
|
||||
str, err := celebratoday.APIClient(webapp.Config)
|
||||
|
||||
if err != nil {
|
||||
fmt.Printf("Error: %s\n", err)
|
||||
}
|
||||
|
||||
fmt.Println(str)
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// Implements initialisation app for flickr service. Gains Tokens, etc.
|
||||
package main
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Package main get flickr oauth keys required for proper client work an stores it locally.
|
||||
package main
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Package main ensures that oauth keys downloaded correctly and client part is working.
|
||||
package main
|
||||
|
||||
import (
|
||||
|
||||
Reference in New Issue
Block a user