-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
35 lines (25 loc) 路 739 Bytes
/
Copy pathmain.go
File metadata and controls
35 lines (25 loc) 路 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package main
import (
"fmt"
"net/http"
)
func main() {
// Here we are just printing a random Hash in order to verify
// on Go tests if everything is working fine. This way, we can
// implement this into the Sonarqube analysis (This is an EXAMPLE)
http.HandleFunc("/first", handlerSecondHash)
http.HandleFunc("/second", handlerFirstHash)
http.ListenAndServe(":8080", nil)
}
func getFirstHash() string {
return "8743b52063cd84097a65d1633f5c74f5"
}
func getSecondHash() string {
return "0cc175b9c0f1b6a831c399e269772661"
}
func handlerFirstHash(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, getFirstHash())
}
func handlerSecondHash(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, getSecondHash())
}