Skip to content

First iteration#1

Open
xails-git wants to merge 7 commits into
mainfrom
first-iteration
Open

First iteration#1
xails-git wants to merge 7 commits into
mainfrom
first-iteration

Conversation

@xails-git
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

@dirtymew dirtymew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Привет Алексей

работа принята - но есть комментарии, обрати внимание

Comment thread cmd/main.go
logger := log.New(os.Stdout, "SERVER:", log.LstdFlags)
srv := server.New(logger)

logger.Println("Запуск сервера...")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут в лог стоило добавить порт на котором сервер запускается

}

w.Header().Set("Content-Type", "text/html; charset=utf-8")
w.Write(data)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ошибка не обработана


// Формируем абсолютный путь к index.html
indexPath := filepath.Join(wd, "index.html")
data, err := os.ReadFile(indexPath)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

можно проще

http.ServeFile

// Парсинг формы с увеличенным лимитом памяти
if err := r.ParseMultipartForm(maxMemory); err != nil {
log.Printf("Ошибка парсинга формы: %v", err)
http.Error(w, "Bad Request", http.StatusBadRequest)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

по заданию статус при ошибках http.StatusInternalServerError

}

func isMorse(s string) bool {
return regexp.MustCompile(`^[\s.\-/]+$`).MatchString(s)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лучше использовать strings.ContainsFunc чем регулярки

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants