Explorar o código

Удалить 'main.go'

gr782_lva %!s(int64=3) %!d(string=hai) anos
pai
achega
221dd090a5
Modificáronse 1 ficheiros con 0 adicións e 52 borrados
  1. 0 52
      main.go

+ 0 - 52
main.go

@@ -1,52 +0,0 @@
-/******************************************************************************
-
-                            Online Go Lang Compiler.
-                Code, Compile, Run and Debug Go Lang program online.
-Write your code in this editor and press "Run" button to execute it.
-
-*******************************************************************************/
-
-
-package main
-
-import (
-"fmt"
-"log"
-"net/http"
-"strings"
-"time"
-)
-
-func main() {
-http.HandleFunc("/", slash) // Устанавливаем роутер (Следующие аналогично)
-http.HandleFunc("/ok", ok) // Устанавливаем роутер ok
-http.HandleFunc("/info", info) // Устанавливаем роутер info
-http.HandleFunc("/status", status) // Устанавливаем роутер info
-err := http.ListenAndServe(":80", nil) // Ставим порт 80 так как HTTP
-if err != nil {
-log.Fatal("ListenAndServe: ", err)
-}
-}
-
-func slash (w http.ResponseWriter,r *http.Request) {
-fmt.Fprint(w,"Если вы видите этот текст, значит это каким то образом работает")
-}
-func ok (w http.ResponseWriter,r *http.Request) {
-w.WriteHeader(http.StatusOK)
-fmt.Fprint(w,"Возвращает для HTTP статус OK")
-}
-func info (w http.ResponseWriter,r *http.Request) {
-fmt.Fprint(w,"Выдает информацию о хозяине то есть Ли Владислав")
-}
-
-func status (w http.ResponseWriter,r *http.Request) {
-var remoteIp = r.RemoteAddr
-var splitIp = strings.Split(remoteIp, ".")
-var fmtIP = fmt.Sprint(splitIp[0], ".x.x.", strings.Split(splitIp[3], ":")[0])
-
-var fmtDate = time.Now().Format("2006-01-02 3:4:5 pm")
-
-fmt.Fprintf(w,"Ли Владислав\n")
-fmt.Fprintf(w, fmtDate + "\n")
-fmt.Fprintf(w, fmtIP)
-}