<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Francisco Daines</title>
    <description>The latest articles on Forem by Francisco Daines (@fdaines).</description>
    <link>https://forem.com/fdaines</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F609116%2Fc9e1bc28-4e4f-4d69-a173-6ccf7d4cc35e.png</url>
      <title>Forem: Francisco Daines</title>
      <link>https://forem.com/fdaines</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/fdaines"/>
    <language>en</language>
    <item>
      <title>Introducing Go-Architect</title>
      <dc:creator>Francisco Daines</dc:creator>
      <pubDate>Fri, 22 Dec 2023 14:50:27 +0000</pubDate>
      <link>https://forem.com/fdaines/introducing-go-architect-7j7</link>
      <guid>https://forem.com/fdaines/introducing-go-architect-7j7</guid>
      <description>&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In this article, I will introduce you to a tool called &lt;a href="https://go-architect.github.io/" rel="noopener noreferrer"&gt;Go-Architect&lt;/a&gt;, we will see its main features and how it can be used to analyze the architecture of a project in Go language.&lt;/p&gt;

&lt;h3&gt;
  
  
  TL/DR
&lt;/h3&gt;

&lt;p&gt;You can find the complete project documentation at &lt;a href="https://go-architect.github.io/" rel="noopener noreferrer"&gt;https://go-architect.github.io/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Go-Architect?
&lt;/h2&gt;

&lt;p&gt;Go-Architect is a Software Architecture Analysis Tool for projects written in Go language. You can use this tool to analyze the design of your artifacts in order to ease decisions related to refactoring your code, fixing issues or evolving the artifact's features. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faf8vhnfi3pwceoixkaqh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faf8vhnfi3pwceoixkaqh.png" alt="Go-Architect First View"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Why we should use an Architecture Analysis Tool?
&lt;/h3&gt;

&lt;p&gt;Software Architecture Analysis Tool are used to improve quality and maintainability of software architectures.&lt;/p&gt;

&lt;p&gt;There are some benefits for using this kind of tools, like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;&lt;strong&gt;Early Detection of Design Flaws:&lt;/strong&gt;&lt;/em&gt; Architecture analysis tools can help identify design flaws, inconsistencies,
or violations of architectural principles before they become critical issues, saving time and resources by addressing problems
when they are easier and cheaper to fix.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;&lt;strong&gt;Quality Assurance:&lt;/strong&gt;&lt;/em&gt; These kind of tools can enforce best practices, coding standards and clean architecture concepts, ensuring that the software architecture adheres to established guidelines.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;&lt;strong&gt;Enhance Maintainability:&lt;/strong&gt;&lt;/em&gt; Ensuring that our architecture adheres to established architectural guidelines over time.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;&lt;strong&gt;Architectural Evolution Analysis:&lt;/strong&gt;&lt;/em&gt; This tools offers several ways to analyze (in different ways) the changes in software architecture over the time.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;p&gt;Go-Architect Provides the following set of analysis tools.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjdrg9b5hkjkur6ws5fju.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjdrg9b5hkjkur6ws5fju.png" alt="Analysis Tools"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Project Metrics
&lt;/h3&gt;

&lt;p&gt;This Tool display common metrics used to have a quick idea of the size and complexity of our project.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs9b5wpcvz8yfzbvmfqtc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs9b5wpcvz8yfzbvmfqtc.png" alt="Project Metrics Tool"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Dependencies Graph
&lt;/h3&gt;

&lt;p&gt;The Dependency Graph is a visual representation that illustrates the relationships and dependencies between packages in a software artifact. It helps developers and maintainers understand packages relations, which is crucial for managing and building complex software projects.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh0l82sitwzqw742gfesj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh0l82sitwzqw742gfesj.png" alt="Dependencies Graph Tool"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Dependency Structure Matrix
&lt;/h3&gt;

&lt;p&gt;The Dependency Structure Matrix (DSM) Tool is a graphical representation used to visualize and analyze dependencies between packages in a Project.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fww29eg7iqmu6ckjxs1fy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fww29eg7iqmu6ckjxs1fy.png" alt="Dependency Structure Matrix Tool"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Instability &amp;amp; Abstractness
&lt;/h3&gt;

&lt;p&gt;The Instability v/s Abstractness Graph is a powerful tool used to analyze how maintainable, flexible, and easy to understand is an artifact.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb2rdc92818pc2t0f0m6s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb2rdc92818pc2t0f0m6s.png" alt="Instability and Abstractness Tool"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Dependency Coupling Analysis
&lt;/h3&gt;

&lt;p&gt;Dependency Coupling Tool helps us to detect how coupled is our artifact with a specific dependency, that can be an internal, same organization, external or a standard package. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq84hzzdqx8qkyfyhtuc9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq84hzzdqx8qkyfyhtuc9.png" alt="Dependency Coupling Tool"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  VCS Analysis
&lt;/h3&gt;

&lt;p&gt;This tool is focused on analyze the VCS history of the artifact, displaying some information about contributions and changes over packages/files in the artifact.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu43sx2b59bqli1abg8o7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu43sx2b59bqli1abg8o7.png" alt="VCS Analysis Tools"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Requirements
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Go v1.19 (&lt;a href="https://go.dev/doc/install" rel="noopener noreferrer"&gt;https://go.dev/doc/install&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;GoCyclo (&lt;a href="https://pkg.go.dev/github.com/fzipp/gocyclo" rel="noopener noreferrer"&gt;https://pkg.go.dev/github.com/fzipp/gocyclo&lt;/a&gt;) for Cyclomatic complexity metrics&lt;/li&gt;
&lt;li&gt;GoCognit (&lt;a href="https://pkg.go.dev/github.com/uudashr/gocognit" rel="noopener noreferrer"&gt;https://pkg.go.dev/github.com/uudashr/gocognit&lt;/a&gt;) for Cognitive complexity metrics&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Installation Process
&lt;/h3&gt;

&lt;p&gt;At the moment, installing Go-Architect can only be done manually, by executing the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/go-architect/go-architect
&lt;span class="nb"&gt;cd &lt;/span&gt;go-architect
make &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this article, we have explored the basics of Go-Architect, an Architecture Analysis Tool for Go projects that can be used to improve maintainability, detect design flaws and ensure quality in your project.&lt;/p&gt;

&lt;p&gt;You can find the project documentation at &lt;a href="https://go-architect.github.io/" rel="noopener noreferrer"&gt;https://go-architect.github.io/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>go</category>
      <category>architecture</category>
      <category>guidelines</category>
      <category>codequality</category>
    </item>
    <item>
      <title>Introducing Arch-Go</title>
      <dc:creator>Francisco Daines</dc:creator>
      <pubDate>Tue, 20 Apr 2021 22:53:18 +0000</pubDate>
      <link>https://forem.com/fdaines/introducing-arch-go-4dch</link>
      <guid>https://forem.com/fdaines/introducing-arch-go-4dch</guid>
      <description>&lt;h1&gt;
  
  
  Summary
&lt;/h1&gt;

&lt;p&gt;In this article, we'll show what is &lt;a href="https://pkg.go.dev/github.com/fdaines/arch-go" rel="noopener noreferrer"&gt;Arch-Go&lt;/a&gt; and how to use it in order to check the architecture of a project in Go.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is Arch-Go?
&lt;/h1&gt;

&lt;p&gt;Arch-Go is a testing tool that verifies if your Go project adheres to your architectural guidelines. &lt;/p&gt;

&lt;h2&gt;
  
  
  A little review of architectural guidelines
&lt;/h2&gt;

&lt;p&gt;The architectural guidelines of a system defines properties like the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How packages are defined&lt;/li&gt;
&lt;li&gt;How packages interact&lt;/li&gt;
&lt;li&gt;What kind of assets should be part of each package&lt;/li&gt;
&lt;li&gt;Some properties related to specific assets, for example it describes some functions or interfaces properties.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For instance, let's think that you're working on a Rest Service using a layered structure containing the following three packages: &lt;em&gt;presentation&lt;/em&gt;, &lt;em&gt;businesslogic&lt;/em&gt; and &lt;em&gt;persistence&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Presentation:&lt;/strong&gt; it contains our REST handlers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Business Logic:&lt;/strong&gt; it contains the components that encapsulates the business logic of our service.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Persistence:&lt;/strong&gt; it contains components to access our persistence services, like a database client.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0uf9knxq6kh7dwuohi0m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0uf9knxq6kh7dwuohi0m.png" title="REST Service using a layered architecture." alt="REST Service using a layered architecture."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we have decided to use a layered architecture, we can find out some dependency rules between its packages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The components in &lt;em&gt;presentation&lt;/em&gt; package should depend only on components in the &lt;em&gt;businesslogic&lt;/em&gt; package.&lt;/li&gt;
&lt;li&gt;The components in &lt;em&gt;businesslogic&lt;/em&gt; package should depend only on components in the &lt;em&gt;persistence&lt;/em&gt; package.&lt;/li&gt;
&lt;li&gt;Components in &lt;em&gt;persistence&lt;/em&gt; package should not depend on any other package.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What happens if a developer includes a dependency that is not allowed?, for example, a handler that depends on a persistence component. Of course, we should detect this violation in a Pull-Request code review, but as this process is manual then is prone to errors, so we can easily get the following result.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwx2for9slyeurswbvajc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwx2for9slyeurswbvajc.png" title="REST Service using a layered architecture that includes not allowed dependencies." alt="REST Service using a layered architecture that includes not allowed dependencies."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What are the consequences of including these dependencies?, in terms of functionalities maybe there will be no impact, but related to system maintenance there are some implications, like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unnecessary coupling between &lt;em&gt;presentation&lt;/em&gt; and &lt;em&gt;persistence&lt;/em&gt; layers, so changes in &lt;em&gt;persistence&lt;/em&gt; probably will have an impact on &lt;em&gt;presentation&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;As our handlers have more dependencies, testing them will require more effort.&lt;/li&gt;
&lt;li&gt;Onboarding of new developers will be more complex, as the explanation of dependencies is an important part of this process.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Declarative aproach
&lt;/h2&gt;

&lt;p&gt;Arch-Go uses a declarative approach to set the architecture rules, so in order to specify what rules to check we need to setup a YAML file.&lt;br&gt;
The selection of a declarative approach was made thinking in simplify the comprehension of the architectural rules and to help the sharing of these rules between artifacts, products and teams.&lt;/p&gt;
&lt;h2&gt;
  
  
  Verification rules in Arch-Go
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Rules for dependencies between packages:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Set what dependencies between packages are allowed and what are not allowed.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Rules for packages content:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Set the allowed content for the package (interfaces, structs, functions and methods).&lt;/li&gt;
&lt;li&gt;Set the restricted content for the package (interfaces, structs, functions and methods).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Cyclic dependencies:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Allows to check for dependency cycles in selected packages.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Functions properties:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Set the maximum number of parameters that functions in a package are allowed to receive.&lt;/li&gt;
&lt;li&gt;Set the maximum number of values that functions in a package are allowed to return.&lt;/li&gt;
&lt;li&gt;Set the maximum number of public functions per file.&lt;/li&gt;
&lt;li&gt;Set the maximum number of lines inside a function.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;
  
  
  Architecture validation using Arch-Go
&lt;/h1&gt;
&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;Arch-Go is currently published as a module, so, in order to install it, you need to execute the &lt;code&gt;go get&lt;/code&gt; command, as follows.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ go get -u github.com/fdaines/arch-go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the verification of a successful installation process, you can execute the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ arch-go -h
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Creating Dependencies Rules
&lt;/h2&gt;

&lt;p&gt;Going back to our example service, we can see some dependency rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Components in &lt;em&gt;presentation&lt;/em&gt; package should only depends on components in &lt;em&gt;businesslogic&lt;/em&gt; package.&lt;/li&gt;
&lt;li&gt;Components in &lt;em&gt;businesslogic&lt;/em&gt; package should only depends on components in &lt;em&gt;persistence&lt;/em&gt; package.&lt;/li&gt;
&lt;li&gt;Components in &lt;em&gt;persistence&lt;/em&gt; package should not depends on any other package.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those dependency rules, can be described using the Arch-Go YAML schema as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dependenciesRules:
  - package: "**.presentation"
    shouldOnlyDependsOn:
      - "**.businesslogic"
  - package: "**.businesslogic"
    shouldOnlyDependsOn:
      - "**.persistence"
    shouldNotDependsOn:
      - "**.presentation"
  - package: "**.persistence"
    shouldNotDependsOn:
      - "**.presentation"
      - "**.businesslogic"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Running Arch-Go
&lt;/h2&gt;

&lt;p&gt;To run Arch-Go we will use an example project that has the code and rules defined.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git clone https://github.com/fdaines/arch-go-sample-project.git
$ cd arch-go-sample-project
$ arch-go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As our project complies with our architectural guidelines, the output should be similar to:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fatl725f8sbk5dvytqcy9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fatl725f8sbk5dvytqcy9.png" title="Arch-Go's output when our project complies with the architectural guidelines" alt="Arch-Go's output when our project complies with the architectural guidelines"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Of course, we have a code example that violates a dependency rule (the branch is named: &lt;code&gt;dependency-rule-violation&lt;/code&gt;). To check this example, just run in the command line&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git checkout dependency-rule-violation
$ arch-go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this case, the output from Arch-Go should be similar as follows.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feh53vlqa2m2r18fr5mx9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feh53vlqa2m2r18fr5mx9.png" title="Arch-Go's output when some rules were violated" alt="Arch-Go's output when some rules were violated"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Running Arch-Go as part of a Github Actions Workflow
&lt;/h2&gt;

&lt;p&gt;To include Arch-Go verification as part of a Github actions workflow, you need to include a YAML file under &lt;code&gt;github/workflows/&lt;/code&gt;, with content as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: 'arch-go'

on:
  workflow_dispatch:
  push:
    branches:
      - master

jobs:
  Arch-Go:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - uses: actions/setup-go@v2
        with:
          stable: 'false'
          go-version: '1.15'
      - name: Install Arch-Go
        run: go get -u github.com/fdaines/arch-go
      - name: Run Arch-Go
        run: arch-go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, each time we push into master branch, Github Actions will run this workflow and checks if the code complies with our architectural guidelines.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnt4un8qo0f852p65la18.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnt4un8qo0f852p65la18.png" title="Running Arch-Go as part of a Github Actions Workflow" alt="Running Arch-Go as part of a Github Actions Workflow"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;In this article, we have explored the basics of using Arch-Go to check our projects. Arch-Go simplifies the verification of architectural guidelines improving the quality project for reducing maintenance costs.&lt;/p&gt;

</description>
      <category>go</category>
      <category>architecture</category>
      <category>testing</category>
      <category>tooling</category>
    </item>
  </channel>
</rss>
