mirror of
https://github.com/gmemstr/pogo.git
synced 2024-09-20 01:31:09 +01:00
Run gofmt tool on source files
This commit is contained in:
parent
4727da5c8a
commit
18267d0362
|
@ -7,12 +7,12 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
|
||||||
"io/ioutil"
|
|
||||||
"io"
|
"io"
|
||||||
|
"io/ioutil"
|
||||||
|
"net/http"
|
||||||
"os" // ioOS?
|
"os" // ioOS?
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Write custom CSS to disk or send it back to the client if GET
|
// Write custom CSS to disk or send it back to the client if GET
|
||||||
|
|
|
@ -63,7 +63,6 @@ func watch() {
|
||||||
<-done
|
<-done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Called when a file has been created / changed, uses gorilla feeds
|
// Called when a file has been created / changed, uses gorilla feeds
|
||||||
// fork to add items to feed object
|
// fork to add items to feed object
|
||||||
func generate_rss() {
|
func generate_rss() {
|
||||||
|
|
|
@ -7,11 +7,11 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"crypto/subtle"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"crypto/subtle"
|
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
@ -43,13 +43,13 @@ func JsonHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
// Serve up homepage
|
// Serve up homepage
|
||||||
func HomeHandler(w http.ResponseWriter, r *http.Request) {
|
func HomeHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
data, err := ioutil.ReadFile("assets/index.html")
|
data, err := ioutil.ReadFile("assets/1index.html")
|
||||||
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
w.Write(data)
|
w.Write(data)
|
||||||
} else {
|
} else {
|
||||||
w.WriteHeader(500)
|
w.WriteHeader(500)
|
||||||
w.Write([]byte("500 Something went wrong - " + http.StatusText(500)))
|
w.Write([]byte("Error500 - " + http.StatusText(500)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ func HomeHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
* Code from stackoverflow by user Timmmm
|
* Code from stackoverflow by user Timmmm
|
||||||
* https://stackoverflow.com/questions/21936332/idiomatic-way-of-requiring-http-basic-auth-in-go/39591234#39591234
|
* https://stackoverflow.com/questions/21936332/idiomatic-way-of-requiring-http-basic-auth-in-go/39591234#39591234
|
||||||
*/
|
*/
|
||||||
func BasicAuth(handler http.HandlerFunc,) http.HandlerFunc {
|
func BasicAuth(handler http.HandlerFunc) http.HandlerFunc {
|
||||||
|
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
username := viper.GetString("AdminUsername")
|
username := viper.GetString("AdminUsername")
|
||||||
|
|
Loading…
Reference in a new issue