File tree Expand file tree Collapse file tree 4 files changed +11
-11
lines changed
Expand file tree Collapse file tree 4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ import (
1010 "github.com/blackmarllboro/create-project-struct/internal/pkg/args"
1111)
1212
13- const perm = 0755 // Право доступа для создания папок
13+ const perm = 0755 // Access rights to create folders
1414
15- // Константы с именем подкаталогов проекта
15+ // Constants with the name of the project subdirectories
1616const (
1717 cmdDir = "cmd"
1818 pkgDir = "pkg"
Original file line number Diff line number Diff line change @@ -2,9 +2,10 @@ package file
22
33import (
44 "fmt"
5- "github.com/blackmarllboro/create-project-struct/pkg/version"
65 "os"
76 "path"
7+
8+ "github.com/blackmarllboro/create-project-struct/pkg/version"
89)
910
1011type File struct {
Original file line number Diff line number Diff line change @@ -5,11 +5,10 @@ import (
55 "os"
66)
77
8- // GetProjectName функция для получения имени проекта.
9- // Имя задается через аргумент командной строки.
10- // Задайте аргумент ".", чтобы создать проект в текущей директории.
11- // Булево значение возвращает true в том случае, если приложение
12- // создается в текущем каталоге.
8+ // GetProjectName function for getting the project name. The name is specified
9+ // via a command line argument. Set the argument "." to create a project in the
10+ // current directory. Boolean value returns true if the application is created in
11+ // the current directory.
1312func GetProjectName () (string , bool , error ) {
1413 if len (os .Args ) < 2 {
1514 return "" , false , errors .New ("the project name has not been transferred" )
Original file line number Diff line number Diff line change @@ -6,19 +6,19 @@ import (
66 "strings"
77)
88
9- // GoVersion получает текущую версию go и возвращает ее в формате go X.Y.
9+ // GoVersion receives the current version of go and returns it in go X.Y format .
1010func GoVersion () (string , error ) {
1111 cmd := exec .Command ("go" , "version" )
1212 output , err := cmd .Output ()
1313 if err != nil {
1414 return "" , err
1515 }
1616
17- // для поиска нужной части в строке .
17+ // to search for the desired part in the string .
1818 re := regexp .MustCompile (`go\d+\.\d+(\.\d+)?` )
1919 version := re .FindString (string (output ))
2020
21- // преобразуем к нужному виду .
21+ // convert to the desired form .
2222 version = strings .Replace (version , "go" , "" , 1 )
2323 versionParts := strings .Split (version , "." )
2424 version = "go " + versionParts [1 ] + "." + versionParts [2 ]
You can’t perform that action at this time.
0 commit comments