aaaaaaaaaa just try ææ

This commit is contained in:
Илья Смышляев 2022-11-29 22:04:09 +03:00
parent 3c45b4ae4f
commit 6de56f3078
8 changed files with 16988 additions and 36 deletions

14
main.go
View File

@ -1,16 +1,10 @@
package main package main
import ( import "gotest/solutions"
"fmt"
"gotest/FizzBuzz" var URL = "https://kuvaev-ituniversity.vps.elewise.com/tasks/Чудные вхождения в массив"
"gotest/consecutive"
)
func main() { func main() {
solutions.NewService().MakeGet(URL)
array := []int{1, 2, 4, 3, 6, 5}
fmt.Println("consecutive", consecutive.Consecutive(array))
FizzBuzz.Fizzbuzz()
} }

41
solutions/getTask.go Normal file
View File

@ -0,0 +1,41 @@
package solutions
import (
"io"
"log"
"net/http"
)
func NewService() taskService {
return taskService{}
}
type taskService struct {
store solutionResult
}
func (t taskService) MakeGet(url string) {
res, err := http.Get(url)
if err != nil {
log.Fatal(err)
}
body, err := io.ReadAll(res.Body)
if err != nil {
log.Fatal(err)
}
res.Body.Close()
//b, _ := asn1.MarshalWithParams()
//t.store.Add(Payload(b))
//
//fmt.Println(b)
}
//func FindUnique() {
// fmt.Println()
//
// //for i, _ := range c {
// // fmt.Println(i)
// //}
//
//}

20
solutions/model.go Normal file
View File

@ -0,0 +1,20 @@
package solutions
type UserName string
type TaskName string
type Result int
type Payload string
type solutionResult struct {
Payload []Payload `json:"payload"`
Results []Result `json:"results"`
}
type Solution struct {
UserName UserName `json:"user_name"`
TaskName TaskName `json:"task_name"`
Results solutionResult `json:"results"`
}

9
solutions/store.go Normal file
View File

@ -0,0 +1,9 @@
package solutions
func NewPayloadStore() solutionResult {
return solutionResult{Payload: []Payload{}}
}
func (c *solutionResult) Add(payload Payload) {
c.Payload = append(c.Payload, payload)
}

View File

@ -1,4 +0,0 @@
package solutions
type Task struct {
}

View File

@ -1 +0,0 @@
package solutions

File diff suppressed because it is too large Load Diff