{"id":350957,"date":"2023-07-29T09:01:15","date_gmt":"2023-07-29T09:01:15","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=350957"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=350957","title":{"rendered":"<span>Golang \u2014 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u043b\u0438\u043d\u0442\u0435\u0440<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 go, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043b\u0438\u043d\u0442\u0435\u0440\u044b. \u041e\u0434\u0438\u043d \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432\u00a0\u2014 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0439.<\/p>\n<p>\u0412 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u00a0\u2014 \u044d\u0442\u043e \u0442\u043e, \u043a\u0430\u043a\u00a0\u043a\u043e\u0434 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d \u043f\u043e \u00ab\u0441\u043b\u043e\u044f\u043c\u00bb, \u0438 \u043a\u0430\u043a\u0438\u0435 \u0441\u043b\u043e\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u0441\u0432\u043e\u0439 <strong>\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439<\/strong>, <strong>open-source<\/strong>, \u043b\u0438\u043d\u0442\u0435\u0440 \u0441 <strong>MIT<\/strong> \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439 \u0438 \u0447\u0435\u043c \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u0435\u043d.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/deb\/e6f\/88a\/debe6f88ae42176926cb952ee4bf3590.png\" width=\"1920\" height=\"680\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/deb\/e6f\/88a\/debe6f88ae42176926cb952ee4bf3590.png\"\/><\/figure>\n<h2>TLDR \u2014 Getting started<\/h2>\n<p>\u041b\u0438\u043d\u0442\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043b\u044e\u0431\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u043d\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u043e\u0434\u043d\u0438\u043c \u0410\u041f\u0418 \u043c\u0435\u0442\u043e\u0434\u043e\u043c:<\/p>\n<pre><code>GET \/books?author=Joe<\/code><\/pre>\n<p>\u0423 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0441\u043b\u043e\u0438:<\/p>\n<ul>\n<li>\n<p><strong>handler<\/strong> (\u0442\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 API \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0435\u0439 \u0438 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 in\/out \u0434\u0430\u043d\u043d\u044b\u0445)<\/p>\n<\/li>\n<li>\n<p><strong>service<\/strong> (\u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430)<\/p>\n<\/li>\n<li>\n<p><strong>repository<\/strong> (\u0438\u043d\u0444\u0440\u043e\u0432\u044b\u0439 \u0441\u043b\u043e\u0439 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c)<\/p>\n<\/li>\n<li>\n<p><strong>models<\/strong> (\u0442\u0443\u0442 \u0431\u0443\u0434\u0443\u0442 \u043b\u0435\u0436\u0430\u0442\u044c domain DTO&#8217;\u0448\u043a\u0438)<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u044b \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 <strong>repository<\/strong> \u043c\u043e\u0433 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e <strong>service<\/strong> \u0441\u043b\u043e\u0439, \u043d\u043e \u043d\u0435 \u043c\u043e\u0433 <strong>handler<\/strong>, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f17\/99c\/405\/f1799c405fffccd3d132c3910040fef3.png\" width=\"1920\" height=\"680\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f17\/99c\/405\/f1799c405fffccd3d132c3910040fef3.png\"\/><\/figure>\n<p>\u0422\u0430\u043a\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 yml \u0444\u0430\u0439\u043b\u0438\u043a\u0430:<\/p>\n<pre><code class=\"yaml\">version: 3 workdir: internal  components:   handler:    { in: handlers\/* }   service:    { in: services\/* }   repository: { in: repositories\/* }   models:     { in: models\/** }  commonComponents:   - models  deps:   handler:     mayDependOn:       - service    service:     mayDependOn:       - repository<\/code><\/pre>\n<p><em>p.s. \u043a \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043f\u043e\u043b\u0435\u0439 \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435.<\/em><\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c 1 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0440\u044f\u043c\u043e \u0432 <code>main.go<\/code> \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0442\u044c\u0441\u044f. \u0422\u0443\u0442 \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0431\u043e\u0440\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<pre><code class=\"go\">func main() {   repository := booksRepository.NewRepository()   service := booksService.NewService(repository)   handler := booksHandler.NewHandler(service)    books, err := handler.Books(\"Joe\")   if err != nil {     panic(err)   }    for _, book := range books {     fmt.Printf(\"Book %d has author %s\\n\", book.ID, book.Author)   }    os.Exit(0) }<\/code><\/pre>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043b\u0438\u043d\u0442\u0435\u0440 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0435 \u00abOK\u00bb:<\/p>\n<pre><code>$ go-arch-lint check OK - No warnings found<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043a\u043e\u0434 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043d\u0430\u0440\u0443\u0448\u0430\u043b \u043f\u0440\u0430\u0432\u0438\u043b\u0430:<\/p>\n<pre><code class=\"go\">func main() {   \/\/ ..   repository := booksRepository.NewRepository()   handler := booksHandler.NewHandler(     service,     repository, \/\/ \u043d\u0430\u0440\u0443\u0448\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0442\u0443\u0442!   )   \/\/ .. }<\/code><\/pre>\n<p>\u0418 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0435\u0449\u0451 \u0440\u0430\u0437:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/51d\/943\/4b7\/51d9434b7a0d8a95832b0dd19bb3c8fc.png\" width=\"1920\" height=\"680\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/51d\/943\/4b7\/51d9434b7a0d8a95832b0dd19bb3c8fc.png\"\/><\/figure>\n<p>\u0422\u0443\u0442 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0439 \u043a\u043e\u0434, \u0433\u0434\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0438 \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u043e, \u0438 \u043c\u043e\u0436\u0435\u043c \u044d\u0442\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c.<\/p>\n<h2>\u041a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043b\u0438\u043d\u0442\u0435\u0440 \u0432 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442<\/h2>\n<p>\u0421 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u043e\u0439 \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u00a0\u2014 \u0432\u00a0\u043d\u0435\u0439 \u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u00ab\u0433\u0440\u044f\u0437\u043d\u044b\u0439\u00bb \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0430\u043c\u044b\u043c \u043d\u0435\u044f\u0432\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043d\u0430\u0440\u0443\u0448\u0438\u0442 \u00ab\u0447\u0438\u0441\u0442\u0443\u044e\u00bb \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u00a0\u043b\u0438\u043d\u0442\u0435\u0440\u0430 \u0432\u00a0\u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0448\u0430\u0433\u043e\u0432:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/234\/021\/8b7\/2340218b7050de813a8ee39f0174cf58.png\" width=\"1920\" height=\"680\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/234\/021\/8b7\/2340218b7050de813a8ee39f0174cf58.png\"\/><\/figure>\n<ol>\n<li>\n<p>\u0422\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 <strong>.go-arch-lint.yml<\/strong> \u0444\u0430\u0439\u043b \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b<\/p>\n<\/li>\n<li>\n<p>\u041b\u0438\u043d\u0442\u0435\u0440 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0432\u00a0\u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0418\u0445 \u043d\u0435\u00a0\u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0440\u0430\u0437\u0443, \u0430\u00a0\u043c\u043e\u0436\u043d\u043e \u00ab\u043b\u0435\u0433\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u00bb \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0432\u00a0\u043a\u043e\u043d\u0444\u0438\u0433 \u0438 <strong>todo<\/strong> \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u043c (\u043c\u043e\u0436\u043d\u043e \u0441\u00a0\u0441\u0441\u044b\u043b\u043a\u043e\u0439 \u043d\u0430\u00a0\u0437\u0430\u0434\u0430\u0447\u0443 \u0432\u00a0jira \u0438\u043b\u0438 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e \u0442\u0440\u0435\u043a\u0435\u0440\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e, \u0432 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u0442\u0435\u0445. \u0434\u043e\u043b\u0433 \u0438 \u0442.\u043f. \u043c\u043e\u0436\u043d\u043e \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0433\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0430\u043a\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043b\u0438\u043d\u0442\u0435\u0440 \u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u0440\u0430\u0437\u0443, \u0445\u043e\u0442\u044c \u043c\u044b \u043f\u043e\u043a\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0443\u043b\u0443\u0447\u0448\u0438\u043b\u0438, \u043d\u043e \u0437\u0430\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0438\u0434\u0438\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0438 \u043c\u043e\u0436\u0435\u043c \u0438\u0445 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043b\u0438\u043d\u0442\u0435\u0440 \u043d\u0435 \u0434\u0430\u0441\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0438 \u0443\u0436\u0435 \u044d\u0442\u0438\u043c \u043f\u0440\u0438\u043d\u043e\u0441\u0438\u0442 \u043f\u043e\u043b\u044c\u0437\u0443.<\/p>\n<h2>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0435\u043d\u0434\u043e\u0440\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/h2>\n<p>\u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u043d\u043e \u0438 \u0442\u043e, \u043a\u0430\u043a\u0438\u0435 \u0432\u0435\u043d\u0434\u043e\u0440\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0432\u0430\u0448\u0435\u043c \u043a\u043e\u0434\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c3a\/f0a\/328\/c3af0a32897f5b2439a66d59a4ff3e6a.png\" width=\"1920\" height=\"680\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c3a\/f0a\/328\/c3af0a32897f5b2439a66d59a4ff3e6a.png\"\/><\/figure>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433:<\/p>\n<ul>\n<li>\n<p>\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c <code>allow.depOnAnyVendor<\/code> \u0432 <code>false<\/code> \u2014 \u0442\u0435\u043f\u0435\u0440\u044c \u043b\u0438\u043d\u0442\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0432\u0435\u043d\u0434\u043e\u0440\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u0435 <code>vendors<\/code> \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0432\u0435\u043d\u0434\u043e\u0440\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/p>\n<\/li>\n<li>\n<p>\u0432 \u043f\u043e\u043b\u0435 <code>commonVendors<\/code> \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0435\u043d\u0434\u043e\u0440\u043d\u044b\u0435 \u043b\u0438\u0431\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u043b\u044e\u0431\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/p>\n<\/li>\n<li>\n<p>\u0432 \u0433\u0440\u0430\u0444\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043f\u043e\u043b\u0435 <code>canUse<\/code> \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0435\u043d\u0434\u043e\u0440\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c (\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c)<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"yaml\">version: 3 allow:   depOnAnyVendor: false  ..  vendors:   company:           { in: my-company.example.com\/*\/pkg\/** }   validation:        { in: github.com\/go-ozzo\/ozzo-validation }   observability:     in:       - github.com\/prometheus\/**       - github.com\/uber-go\/zap       - go.opentelemetry.io\/otel       - go.opentelemetry.io\/otel\/*  commonVendors:   - company   - observability  deps:   handler:     mayDependOn:       - service     canUse:       - validation<\/code><\/pre>\n<h2>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0438\u043d\u0442\u0435\u0440<\/h2>\n<p>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u043b\u0438\u043d\u0442\u0435\u0440 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 3 \u0447\u0430\u0441\u0442\u0435\u0439:<\/p>\n<p><strong>Component<\/strong>\u00a0\u2014 \u044d\u0442\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f \u043d\u0430\u0434 <strong>package<\/strong> (\u043f\u0430\u043a\u0435\u0442\u043e\u043c). <strong>\u041e\u0434\u0438\u043d \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442<\/strong> \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432\u00a0\u0441\u0435\u0431\u044f <strong>\u043e\u0434\u0438\u043d \u0438\u043b\u0438\u00a0\u0431\u043e\u043b\u0435\u0435 \u043f\u0430\u043a\u0435\u0442\u043e\u0432<\/strong>.<\/p>\n<p><strong>Dependency<\/strong>\u00a0\u2014 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c. \u041e\u043d\u0438\u00a0\u0431\u044b\u0432\u0430\u044e\u0442 \u0434\u0432\u0443\u0445 \u0432\u0438\u0434\u043e\u0432: \u044f\u0432\u043d\u044b\u0435 \u0438 \u043d\u0435\u044f\u0432\u043d\u044b\u0435.<\/p>\n<ul>\n<li>\n<p><em>\u042f\u0432\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/em>\u00a0\u2014 \u044d\u0442\u043e <code>import<\/code> \u0432\u00a0\u0444\u0430\u0439\u043b\u0435 \u0441\u00a0\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442\u00a0\u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p><em>\u041d\u0435\u044f\u0432\u043d\u044b\u0435<\/em>\u00a0\u2014 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438\u043b\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0441 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u043a\u0430\u043d\u0430\u043b\u044b \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b<\/p>\n<\/li>\n<\/ul>\n<p><strong>Dependency tree<\/strong>\u00a0\u2014 \u0433\u0440\u0430\u0444 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 (\u043a\u043e\u043c\u0443 \u0438 \u043e\u0442 \u043a\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c)<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0441\u043b\u043e\u044f\u043c\u0438:<\/p>\n<pre><code class=\"yaml\">components:   handler:    { in: handlers\/* }   service:    { in: services\/** }   repository: { in: services\/*\/repository }   models:     in:       - services\/*\/domain      - services\/*\/dto<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u0430\u043f\u043f\u0438\u043d\u0433, \u043c\u043e\u0436\u0435\u043c \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 \u0438 go \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438:<\/p>\n<pre><code>$ go-arch-lint mapping<\/code><\/pre>\n<pre><code class=\"1c\">Package                         | Compoenent ---------------------------------------------- internal                        | -   handlers                      | -     articles                    | handler     auth                        | handler     books                       | handler     info                        | handler     user                        | handler   services                      | -     auth                        | -       logic                     | service       dto                       | models       repository                | repository     books                       | -       somecode                  | service       domain                    | models       repository                | repository     user                        | -       admin                     | service       groups                    | service       dto                       | models       repository                | repository<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e wildcard \u043c\u0430\u0441\u043e\u043a \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 <strong>package<\/strong>, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 <code>internal\/services\/auth\/repository\/example<\/code> \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442 2 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>service \u0432 <code>services\/**<\/code><\/p>\n<\/li>\n<li>\n<p>repository \u0432 <code>services\/*\/repository<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443. \u041b\u0438\u043d\u0442\u0435\u0440 \u0432\u044b\u0431\u0435\u0440\u0435\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441 \u0441\u0430\u043c\u044b\u043c \u0442\u043e\u0447\u043d\u044b\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043f\u0443\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u043c\u0430\u0441\u043a\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0438\u043b\u0438 \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443.<\/p>\n<h2>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043b\u0438\u043d\u0442\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f7d\/ea6\/14c\/f7dea614c7c647d0a4b462896b8cf375.png\" width=\"1920\" height=\"680\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f7d\/ea6\/14c\/f7dea614c7c647d0a4b462896b8cf375.png\"\/><\/figure>\n<ul>\n<li>\n<p>\u0440\u0430\u0437\u043c\u0435\u0447\u0430\u0435\u0442 \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043d\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>\u0441\u0442\u0440\u043e\u0438\u0442 \u0433\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/p>\n<\/li>\n<li>\n<p>\u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0438 \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0439 \u0433\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043d\u0435\u043f\u0443\u0441\u0442\u043e\u0439 DIFF\u00a0\u2014 \u0437\u043d\u0430\u0447\u0438\u0442, \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b<\/p>\n<\/li>\n<\/ul>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a<\/h2>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430:<\/p>\n<pre><code class=\"bash\">go install github.com\/fe3dback\/go-arch-lint@latest<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a:<\/p>\n<pre><code class=\"bash\">cd code\/acme\/my-project go-arch-lint check<\/code><\/pre>\n<p>\u0414\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: <a href=\"https:\/\/github.com\/fe3dback\/go-arch-lint\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/fe3dback\/go-arch-lint<\/a><\/p>\n<h2>\u041f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f jetbrains IDE \/ goland<\/h2>\n<p>\u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d: <a href=\"https:\/\/plugins.jetbrains.com\/plugin\/15423-goarchlint-file-support\" rel=\"noopener noreferrer nofollow\">https:\/\/plugins.jetbrains.com\/plugin\/15423-goarchlint-file-support<\/a><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/697\/3ad\/500\/6973ad50003cfaac2e9c6d39355d67fd.png\" width=\"749\" height=\"637\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/697\/3ad\/500\/6973ad50003cfaac2e9c6d39355d67fd.png\"\/><\/figure>\n<h2>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0442\u0443\u043b\u0437\u0430\u043c\u0438<\/h2>\n<p>\u0412\u0441\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043b\u0438\u043d\u0442\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441 \u0444\u043b\u0430\u0433\u043e\u043c `&#8212;json`. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c, \u043f\u0440\u043e\u0435\u043a\u0442\u0443, \u0441\u0445\u0435\u043c\u0435 \u0438 \u0442.\u043f. \u0447\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0442\u0443\u043b\u0437\u0430\u043c\u0438, CI\/CD \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u043c\u0438 \u0438 \u0442.\u043f.<\/p>\n<pre><code>go-arch-lint check --json<\/code><\/pre>\n<pre><code class=\"json\">{   \"Type\": \"models.Check\",   \"Payload\": {     \/\/ ..     \"ArchWarningsDeepScan\": [       {         \"Gate\": {           \"ComponentName\": \"handler\",           \"MethodName\": \"NewHandler\",           \"Definition\": { .. }         },         \"Dependency\": {           \"ComponentName\": \"repository\",           \"Name\": \"books.Repository\",           \"InjectionAST\": \"repository\",           \"Injection\": {             \"Valid\": true,             \"File\": \"\/go\/src\/acme\/my-project\/main.go\",             \"Line\": 15,             \"Offset\": 37           }         },         \"Target\": { .. }       }     ],     \/\/ ..   } }<\/code><\/pre>\n<h2>\u042d\u043a\u0441\u043f\u043e\u0440\u0442 \u0433\u0440\u0430\u0444\u0430 \u0432 \u0432\u0438\u0434\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438<\/h2>\n<p>\u041c\u043e\u0436\u043d\u043e \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u0432\u0438\u0434\u0435 <strong>svg<\/strong> \u0444\u0430\u0439\u043b\u0438\u043a\u0430 \u0438\u043b\u0438 <strong>d2<\/strong> \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f.<\/p>\n<pre><code class=\"bash\">go-arch-lint graph go-arch-lint graph --d2<\/code><\/pre>\n<pre><code class=\"coffeescript\">handler -> service service -> repository<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d00\/f4d\/494\/d00f4d494d7fd70f35aa2ba0ff88fcf5.png\" width=\"378\" height=\"696\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d00\/f4d\/494\/d00f4d494d7fd70f35aa2ba0ff88fcf5.png\"\/><\/figure>\n<h2>\u041f\u043b\u0430\u0433\u0438\u043d\u044b \u043a \u0434\u0440\u0443\u0433\u0438\u043c IDE\/\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430\u043c<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u043a\u043e\u0433\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0435\u0441\u0442\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u0432 (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 vscode), \u0432 \u043b\u0438\u043d\u0442\u0435\u0440\u0435 \u0435\u0441\u0442\u044c \u0434\u043e\u043f. \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439.<\/p>\n<pre><code class=\"bash\"># \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0435 go-arch-lint self-inspect --json  # Json-schema \u0434\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 yaml \u043a\u043e\u043d\u0444\u0438\u0433\u0430 go-arch-lint schema --version 3 # {\"$schema\":\"http:\/\/json-schema.org\/draft-07\/schema#\", ...  # \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 json go-arch-lint check --json  # \u041c\u0430\u043f\u043f\u0438\u043d\u0433 go \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043d\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b go-arch-lint mapping --json<\/code><\/pre>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u0444\u043b\u0430\u0433\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 <strong>&#8212;help<\/strong><\/p>\n<pre><code class=\"bash\">go-arch-lint --help              Usage:   go-arch-lint [command]  Available Commands:   check        check project architecture by yaml file   completion   Generate the autocompletion script for the specified shell   graph        output dependencies graph as svg file   help         Help about any command   mapping      mapping table between files and components   schema       json schema for arch file inspection   self-inspect will validate arch config and arch setup   version      Print go arch linter version  Flags:   -h, --help                   help for go-arch-lint       --json                   (alias for --output-type=json) <\/code><\/pre>\n<h2>Contributing<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u043e\u043c\u043e\u0447\u044c \u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439, \u043c\u043e\u0436\u043d\u043e<a href=\"https:\/\/github.com\/fe3dback\/go-arch-lint\" rel=\"noopener noreferrer nofollow\"> \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043a\u043e\u0434 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/751174\/\"> https:\/\/habr.com\/ru\/articles\/751174\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 go, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043b\u0438\u043d\u0442\u0435\u0440\u044b. \u041e\u0434\u0438\u043d \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u043b\u0438\u043d\u0442\u0435\u0440\u043e\u0432\u00a0\u2014 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0439.<\/p>\n<p>\u0412 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u00a0\u2014 \u044d\u0442\u043e \u0442\u043e, \u043a\u0430\u043a\u00a0\u043a\u043e\u0434 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d \u043f\u043e \u00ab\u0441\u043b\u043e\u044f\u043c\u00bb, \u0438 \u043a\u0430\u043a\u0438\u0435 \u0441\u043b\u043e\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u0441\u0432\u043e\u0439 <strong>\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439<\/strong>, <strong>open-source<\/strong>, \u043b\u0438\u043d\u0442\u0435\u0440 \u0441 <strong>MIT<\/strong> \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439 \u0438 \u0447\u0435\u043c \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u0435\u043d.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h2>TLDR \u2014 Getting started<\/h2>\n<p>\u041b\u0438\u043d\u0442\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043b\u044e\u0431\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u043d\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u043e\u0434\u043d\u0438\u043c \u0410\u041f\u0418 \u043c\u0435\u0442\u043e\u0434\u043e\u043c:<\/p>\n<pre><code>GET \/books?author=Joe<\/code><\/pre>\n<p>\u0423 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0441\u043b\u043e\u0438:<\/p>\n<ul>\n<li>\n<p><strong>handler<\/strong> (\u0442\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 API \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0435\u0439 \u0438 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 in\/out \u0434\u0430\u043d\u043d\u044b\u0445)<\/p>\n<\/li>\n<li>\n<p><strong>service<\/strong> (\u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430)<\/p>\n<\/li>\n<li>\n<p><strong>repository<\/strong> (\u0438\u043d\u0444\u0440\u043e\u0432\u044b\u0439 \u0441\u043b\u043e\u0439 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c)<\/p>\n<\/li>\n<li>\n<p><strong>models<\/strong> (\u0442\u0443\u0442 \u0431\u0443\u0434\u0443\u0442 \u043b\u0435\u0436\u0430\u0442\u044c domain DTO&#8217;\u0448\u043a\u0438)<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u044b \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 <strong>repository<\/strong> \u043c\u043e\u0433 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e <strong>service<\/strong> \u0441\u043b\u043e\u0439, \u043d\u043e \u043d\u0435 \u043c\u043e\u0433 <strong>handler<\/strong>, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u0430:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0430\u043a\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 yml \u0444\u0430\u0439\u043b\u0438\u043a\u0430:<\/p>\n<pre><code class=\"yaml\">version: 3 workdir: internal  components:   handler:    { in: handlers\/* }   service:    { in: services\/* }   repository: { in: repositories\/* }   models:     { in: models\/** }  commonComponents:   - models  deps:   handler:     mayDependOn:       - service    service:     mayDependOn:       - repository<\/code><\/pre>\n<p><em>p.s. \u043a \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043f\u043e\u043b\u0435\u0439 \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435.<\/em><\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c 1 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0440\u044f\u043c\u043e \u0432 <code>main.go<\/code> \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0442\u044c\u0441\u044f. \u0422\u0443\u0442 \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0431\u043e\u0440\u043a\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<pre><code class=\"go\">func main() {   repository := booksRepository.NewRepository()   service := booksService.NewService(repository)   handler := booksHandler.NewHandler(service)    books, err := handler.Books(\"Joe\")   if err != nil {     panic(err)   }    for _, book := range books {     fmt.Printf(\"Book %d has author %s\\n\", book.ID, book.Author)   }    os.Exit(0) }<\/code><\/pre>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043b\u0438\u043d\u0442\u0435\u0440 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0435 \u00abOK\u00bb:<\/p>\n<pre><code>$ go-arch-lint check OK - No warnings found<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043a\u043e\u0434 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043d\u0430\u0440\u0443\u0448\u0430\u043b \u043f\u0440\u0430\u0432\u0438\u043b\u0430:<\/p>\n<pre><code class=\"go\">func main() {   \/\/ ..   repository := booksRepository.NewRepository()   handler := booksHandler.NewHandler(     service,     repository, \/\/ \u043d\u0430\u0440\u0443\u0448\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0442\u0443\u0442!   )   \/\/ .. }<\/code><\/pre>\n<p>\u0418 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0435\u0449\u0451 \u0440\u0430\u0437:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0443\u0442 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0439 \u043a\u043e\u0434, \u0433\u0434\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0438 \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u043e, \u0438 \u043c\u043e\u0436\u0435\u043c \u044d\u0442\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c.<\/p>\n<h2>\u041a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043b\u0438\u043d\u0442\u0435\u0440 \u0432 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442<\/h2>\n<p>\u0421 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u043e\u0439 \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u00a0\u2014 \u0432\u00a0\u043d\u0435\u0439 \u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u00ab\u0433\u0440\u044f\u0437\u043d\u044b\u0439\u00bb \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0430\u043c\u044b\u043c \u043d\u0435\u044f\u0432\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043d\u0430\u0440\u0443\u0448\u0438\u0442 \u00ab\u0447\u0438\u0441\u0442\u0443\u044e\u00bb \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u00a0\u043b\u0438\u043d\u0442\u0435\u0440\u0430 \u0432\u00a0\u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0448\u0430\u0433\u043e\u0432:<\/p>\n<figure class=\"full-width\"><\/figure>\n<ol>\n<li>\n<p>\u0422\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 <strong>.go-arch-lint.yml<\/strong> \u0444\u0430\u0439\u043b \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b<\/p>\n<\/li>\n<li>\n<p>\u041b\u0438\u043d\u0442\u0435\u0440 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0432\u00a0\u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0418\u0445 \u043d\u0435\u00a0\u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0440\u0430\u0437\u0443, \u0430\u00a0\u043c\u043e\u0436\u043d\u043e \u00ab\u043b\u0435\u0433\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u00bb \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0432\u00a0\u043a\u043e\u043d\u0444\u0438\u0433 \u0438 <strong>todo<\/strong> \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u043c (\u043c\u043e\u0436\u043d\u043e \u0441\u00a0\u0441\u0441\u044b\u043b\u043a\u043e\u0439 \u043d\u0430\u00a0\u0437\u0430\u0434\u0430\u0447\u0443 \u0432\u00a0jira \u0438\u043b\u0438 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e \u0442\u0440\u0435\u043a\u0435\u0440\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e, \u0432 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u0442\u0435\u0445. \u0434\u043e\u043b\u0433 \u0438 \u0442.\u043f. \u043c\u043e\u0436\u043d\u043e \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0433\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0430\u043a\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043b\u0438\u043d\u0442\u0435\u0440 \u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u0440\u0430\u0437\u0443, \u0445\u043e\u0442\u044c \u043c\u044b \u043f\u043e\u043a\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0443\u043b\u0443\u0447\u0448\u0438\u043b\u0438, \u043d\u043e \u0437\u0430\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0438\u0434\u0438\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0438 \u043c\u043e\u0436\u0435\u043c \u0438\u0445 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043b\u0438\u043d\u0442\u0435\u0440 \u043d\u0435 \u0434\u0430\u0441\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0438 \u0443\u0436\u0435 \u044d\u0442\u0438\u043c \u043f\u0440\u0438\u043d\u043e\u0441\u0438\u0442 \u043f\u043e\u043b\u044c\u0437\u0443.<\/p>\n<h2>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0435\u043d\u0434\u043e\u0440\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/h2>\n<p>\u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u043d\u043e \u0438 \u0442\u043e, \u043a\u0430\u043a\u0438\u0435 \u0432\u0435\u043d\u0434\u043e\u0440\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0432\u0430\u0448\u0435\u043c \u043a\u043e\u0434\u0435.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433:<\/p>\n<ul>\n<li>\n<p>\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c <code>allow.depOnAnyVendor<\/code> \u0432 <code>false<\/code> \u2014 \u0442\u0435\u043f\u0435\u0440\u044c \u043b\u0438\u043d\u0442\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0432\u0435\u043d\u0434\u043e\u0440\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u0435 <code>vendors<\/code> \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0432\u0435\u043d\u0434\u043e\u0440\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/p>\n<\/li>\n<li>\n<p>\u0432 \u043f\u043e\u043b\u0435 <code>commonVendors<\/code> \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0435\u043d\u0434\u043e\u0440\u043d\u044b\u0435 \u043b\u0438\u0431\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u043b\u044e\u0431\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/p>\n<\/li>\n<li>\n<p>\u0432 \u0433\u0440\u0430\u0444\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043f\u043e\u043b\u0435 <code>canUse<\/code> \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0435\u043d\u0434\u043e\u0440\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c (\u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c)<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"yaml\">version: 3 allow:   depOnAnyVendor: false  ..  vendors:   company:           { in: my-company.example.com\/*\/pkg\/** }   validation:        { in: github.com\/go-ozzo\/ozzo-validation }   observability:     in:       - github.com\/prometheus\/**       - github.com\/uber-go\/zap       - go.opentelemetry.io\/otel       - go.opentelemetry.io\/otel\/*  commonVendors:   - company   - observability  deps:   handler:     mayDependOn:       - service     canUse:       - validation<\/code><\/pre>\n<h2>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0438\u043d\u0442\u0435\u0440<\/h2>\n<p>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0439 \u043b\u0438\u043d\u0442\u0435\u0440 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 3 \u0447\u0430\u0441\u0442\u0435\u0439:<\/p>\n<p><strong>Component<\/strong>\u00a0\u2014 \u044d\u0442\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f \u043d\u0430\u0434 <strong>package<\/strong> (\u043f\u0430\u043a\u0435\u0442\u043e\u043c). <strong>\u041e\u0434\u0438\u043d \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442<\/strong> \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432\u00a0\u0441\u0435\u0431\u044f <strong>\u043e\u0434\u0438\u043d \u0438\u043b\u0438\u00a0\u0431\u043e\u043b\u0435\u0435 \u043f\u0430\u043a\u0435\u0442\u043e\u0432<\/strong>.<\/p>\n<p><strong>Dependency<\/strong>\u00a0\u2014 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c. \u041e\u043d\u0438\u00a0\u0431\u044b\u0432\u0430\u044e\u0442 \u0434\u0432\u0443\u0445 \u0432\u0438\u0434\u043e\u0432: \u044f\u0432\u043d\u044b\u0435 \u0438 \u043d\u0435\u044f\u0432\u043d\u044b\u0435.<\/p>\n<ul>\n<li>\n<p><em>\u042f\u0432\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/em>\u00a0\u2014 \u044d\u0442\u043e <code>import<\/code> \u0432\u00a0\u0444\u0430\u0439\u043b\u0435 \u0441\u00a0\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442\u00a0\u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p><em>\u041d\u0435\u044f\u0432\u043d\u044b\u0435<\/em>\u00a0\u2014 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438\u043b\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0441 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u043a\u0430\u043d\u0430\u043b\u044b \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b<\/p>\n<\/li>\n<\/ul>\n<p><strong>Dependency tree<\/strong>\u00a0\u2014 \u0433\u0440\u0430\u0444 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 (\u043a\u043e\u043c\u0443 \u0438 \u043e\u0442 \u043a\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c)<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0441\u043b\u043e\u044f\u043c\u0438:<\/p>\n<pre><code class=\"yaml\">components:   handler:    { in: handlers\/* }   service:    { in: services\/** }   repository: { in: services\/*\/repository }   models:     in:       - services\/*\/domain      - services\/*\/dto<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u0430\u043f\u043f\u0438\u043d\u0433, \u043c\u043e\u0436\u0435\u043c \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 \u0438 go \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438:<\/p>\n<pre><code>$ go-arch-lint mapping<\/code><\/pre>\n<pre><code class=\"1c\">Package                         | Compoenent ---------------------------------------------- internal                        | -   handlers                      | -     articles                    | handler     auth                        | handler     books                       | handler     info                        | handler     user                        | handler   services                      | -     auth                        | -       logic                     | service       dto                       | models       repository                | repository     books                       | -       somecode                  | service       domain                    | models       repository                | repository     user                        | -       admin                     | service       groups                    | service       dto                       | models       repository                | repository<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e wildcard \u043c\u0430\u0441\u043e\u043a \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 <strong>package<\/strong>, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 <code>internal\/services\/auth\/repository\/example<\/code> \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442 2 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>service \u0432 <code>services\/**<\/code><\/p>\n<\/li>\n<li>\n<p>repository \u0432 <code>services\/*\/repository<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443. \u041b\u0438\u043d\u0442\u0435\u0440 \u0432\u044b\u0431\u0435\u0440\u0435\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441 \u0441\u0430\u043c\u044b\u043c \u0442\u043e\u0447\u043d\u044b\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043f\u0443\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u043c\u0430\u0441\u043a\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0438\u043b\u0438 \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443.<\/p>\n<h2>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043b\u0438\u043d\u0442\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c<\/h2>\n<figure class=\"full-width\"><\/figure>\n<ul>\n<li>\n<p>\u0440\u0430\u0437\u043c\u0435\u0447\u0430\u0435\u0442 \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043d\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>\u0441\u0442\u0440\u043e\u0438\u0442 \u0433\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/p>\n<\/li>\n<li>\n<p>\u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u0438 \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0439 \u0433\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043d\u0435\u043f\u0443\u0441\u0442\u043e\u0439 DIFF\u00a0\u2014 \u0437\u043d\u0430\u0447\u0438\u0442, \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b<\/p>\n<\/li>\n<\/ul>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a<\/h2>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430:<\/p>\n<pre><code class=\"bash\">go install github.com\/fe3dback\/go-arch-lint@latest<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a:<\/p>\n<pre><code class=\"bash\">cd code\/acme\/my-project go-arch-lint check<\/code><\/pre>\n<p>\u0414\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: <a href=\"https:\/\/github.com\/fe3dback\/go-arch-lint\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/fe3dback\/go-arch-lint<\/a><\/p>\n<h2>\u041f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f jetbrains IDE \/ goland<\/h2>\n<p>\u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d: <a href=\"https:\/\/plugins.jetbrains.com\/plugin\/15423-goarchlint-file-support\" rel=\"noopener noreferrer nofollow\">https:\/\/plugins.jetbrains.com\/plugin\/15423-goarchlint-file-support<\/a><\/p>\n<figure class=\"full-width\"><\/figure>\n<h2>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0442\u0443\u043b\u0437\u0430\u043c\u0438<\/h2>\n<p>\u0412\u0441\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043b\u0438\u043d\u0442\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441 \u0444\u043b\u0430\u0433\u043e\u043c `&#8212;json`. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c, \u043f\u0440\u043e\u0435\u043a\u0442\u0443, \u0441\u0445\u0435\u043c\u0435 \u0438 \u0442.\u043f. \u0447\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0442\u0443\u043b\u0437\u0430\u043c\u0438, CI\/CD \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u043c\u0438 \u0438 \u0442.\u043f.<\/p>\n<pre><code>go-arch-lint check --json<\/code><\/pre>\n<pre><code class=\"json\">{   \"Type\": \"models.Check\",   \"Payload\": {     \/\/ ..     \"ArchWarningsDeepScan\": [       {         \"Gate\": {           \"ComponentName\": \"handler\",           \"MethodName\": \"NewHandler\",           \"Definition\": { .. }         },         \"Dependency\": {           \"ComponentName\": \"repository\",           \"Name\": \"books.Repository\",           \"InjectionAST\": \"repository\",           \"Injection\": {             \"Valid\": true,             \"File\": \"\/go\/src\/acme\/my-project\/main.go\",             \"Line\": 15,             \"Offset\": 37           }         },         \"Target\": { .. }       }     ],     \/\/ ..   } }<\/code><\/pre>\n<h2>\u042d\u043a\u0441\u043f\u043e\u0440\u0442 \u0433\u0440\u0430\u0444\u0430 \u0432 \u0432\u0438\u0434\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438<\/h2>\n<p>\u041c\u043e\u0436\u043d\u043e \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u0432\u0438\u0434\u0435 <strong>svg<\/strong> \u0444\u0430\u0439\u043b\u0438\u043a\u0430 \u0438\u043b\u0438 <strong>d2<\/strong> \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f.<\/p>\n<pre><code class=\"bash\">go-arch-lint graph go-arch-lint graph --d2<\/code><\/pre>\n<pre><code class=\"coffeescript\">handler -> service service -> repository<\/code><\/pre>\n<figure class=\"\"><\/figure>\n<h2>\u041f\u043b\u0430\u0433\u0438\u043d\u044b \u043a \u0434\u0440\u0443\u0433\u0438\u043c IDE\/\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430\u043c<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u043a\u043e\u0433\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0435\u0441\u0442\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u0432 (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 vscode), \u0432 \u043b\u0438\u043d\u0442\u0435\u0440\u0435 \u0435\u0441\u0442\u044c \u0434\u043e\u043f. \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439.<\/p>\n<pre><code class=\"bash\"># \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0435 go-arch-lint self-inspect --json  # Json-schema \u0434\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 yaml \u043a\u043e\u043d\u0444\u0438\u0433\u0430 go-arch-lint schema --version 3 # {\"$schema\":\"http:\/\/json-schema.org\/draft-07\/schema#\", ...  # \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043e\u0434\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 json go-arch-lint check --json  # \u041c\u0430\u043f\u043f\u0438\u043d\u0433 go \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043d\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b go-arch-lint mapping --json<\/code><\/pre>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u0444\u043b\u0430\u0433\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 <strong>&#8212;help<\/strong><\/p>\n<pre><code class=\"bash\">go-arch-lint --help              Usage:   go-arch-lint [command]  Available Commands:   check        check project architecture by yaml file   completion   Generate the autocompletion script for the specified shell   graph        output dependencies graph as svg file   help         Help about any command   mapping      mapping table between files and components   schema       json schema for arch file inspection   self-inspect will validate arch config and arch setup   version      Print go arch linter version  Flags:   -h, --help                   help for go-arch-lint       --json                   (alias for --output-type=json) <\/code><\/pre>\n<h2>Contributing<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u043e\u043c\u043e\u0447\u044c \u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439, \u043c\u043e\u0436\u043d\u043e<a href=\"https:\/\/github.com\/fe3dback\/go-arch-lint\" rel=\"noopener noreferrer nofollow\"> \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043a\u043e\u0434 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/751174\/\"> https:\/\/habr.com\/ru\/articles\/751174\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-350957","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/350957","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=350957"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/350957\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=350957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=350957"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=350957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}