<?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>DEV Community: csm</title>
    <description>The latest articles on DEV Community by csm (@csm18).</description>
    <link>https://dev.to/csm18</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%2F1590922%2F1d71d879-5f9e-42d7-a40e-436badadd278.png</url>
      <title>DEV Community: csm</title>
      <link>https://dev.to/csm18</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/csm18"/>
    <language>en</language>
    <item>
      <title>Git Basics</title>
      <dc:creator>csm</dc:creator>
      <pubDate>Wed, 20 May 2026 02:21:27 +0000</pubDate>
      <link>https://dev.to/csm18/git-basics-2k9b</link>
      <guid>https://dev.to/csm18/git-basics-2k9b</guid>
      <description>&lt;h2&gt;
  
  
  Formal Definition
&lt;/h2&gt;

&lt;p&gt;Git is a free, open-source distributed version control system (VCS) designed to track changes in source code during software development.&lt;/p&gt;

&lt;h3&gt;
  
  
  In English
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A tool that can save the state of our project,from adding a semicolon to a file, to writing hundreds of lines of code.&lt;/li&gt;
&lt;li&gt;Whenever we think this should be saved, we can!&lt;/li&gt;
&lt;li&gt;And whenever we need to see that version, we can!&lt;/li&gt;
&lt;li&gt;Whenever we need to use that version or do changes to it and save again, we can!&lt;/li&gt;
&lt;li&gt;We can save &lt;strong&gt;n&lt;/strong&gt; number of versions of our project and each version can be just as simple as a space char inclusion in a file!&lt;/li&gt;
&lt;li&gt;All of this without taking lot of space in hard disk&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Getting and Setting-Up Git
&lt;/h2&gt;

&lt;p&gt;Check the official website: &lt;a href="https://git-scm.com/" rel="noopener noreferrer"&gt;https://git-scm.com/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;First you initialize a directory as git &lt;strong&gt;repo&lt;/strong&gt; (repository):

&lt;ul&gt;
&lt;li&gt;You do &lt;code&gt;git init&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Git creates a &lt;strong&gt;.git&lt;/strong&gt; hidden folder in  current directory&lt;/li&gt;
&lt;li&gt;This &lt;strong&gt;.git&lt;/strong&gt; folder is what makes your folder a repo and gives those magical powers to see the history and versions of your project.&lt;/li&gt;
&lt;li&gt;If, by any chance, you delete that .git folder, you will loose all the project history, unless you pushed your changes to &lt;strong&gt;github&lt;/strong&gt;!&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;You ask git, what is the status of the project:

&lt;ul&gt;
&lt;li&gt;You do &lt;code&gt;git status&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Git says on branch main, and then shows some filenames in red and says &lt;strong&gt;"Untracked files"&lt;/strong&gt; (if you have files in your repo)&lt;/li&gt;
&lt;li&gt;That simply means git is working and its asking to save the changes if you are done working on them&lt;/li&gt;
&lt;li&gt;The branch thing is explained in the Core Concepts section &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;You ask git to take a screenshot of the changed files:

&lt;ul&gt;
&lt;li&gt;You do &lt;code&gt;git add filename.something&lt;/code&gt; or &lt;code&gt;git add .&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Git takes a screenshot of the specified files&lt;/li&gt;
&lt;li&gt;Keep in mind,&lt;strong&gt;the screenshot is not saved yet&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Its like print screen on pc, we get a window that asks to save it or discard!&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;You ask git to save the screenshot:

&lt;ul&gt;
&lt;li&gt;You do &lt;code&gt;git commit -m "Some message about the changes!"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Git saves the screenshot into the project history&lt;/li&gt;
&lt;li&gt;Each screenshot saved is called a commit&lt;/li&gt;
&lt;li&gt;Each commit has a hash&lt;/li&gt;
&lt;li&gt;That hash is like a name, that we can refer, to ask git to get that version or commit to us&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;You can view all the commits or versions:

&lt;ul&gt;
&lt;li&gt;You do &lt;code&gt;git log&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Git will show all the commits list with details like: Who,when, commit hash, commit message, etc!&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;This is the basic working!&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Core Concepts
&lt;/h2&gt;

&lt;h3&gt;
  
  
  User
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Each commit will include information about the person who made the commit&lt;/li&gt;
&lt;li&gt;That is the &lt;strong&gt;username&lt;/strong&gt; and &lt;strong&gt;email&lt;/strong&gt; address of the person&lt;/li&gt;
&lt;li&gt;This helps others or yourself in future, that &lt;strong&gt;who made the commit&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;User&lt;/strong&gt; is simply a person with username and email set in the git configuration&lt;/li&gt;
&lt;li&gt;This is done by setting the username and password in git like this:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name &lt;span class="s2"&gt;"Your Name"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email &lt;span class="s2"&gt;"your.email@example.com"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Branches
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;All your commits from first one to the last one are like a rope&lt;/li&gt;
&lt;li&gt;You can see the timeline of the commits straight&lt;/li&gt;
&lt;li&gt;This timeline rope is a branch, just like the branch of a tree&lt;/li&gt;
&lt;li&gt;It starts at the root, first commit, then grows!&lt;/li&gt;
&lt;li&gt;By default, the root or main branch is called &lt;strong&gt;main&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Now, if you have an experimental feature that you don't want to save to the current timeline or branch, but still want to save its changes and later when it works fine, want to join it to the current timeline of commits or branch&lt;/li&gt;
&lt;li&gt;For this we have branches and merging&lt;/li&gt;
&lt;li&gt;You can create a branch, do changes to the repo and save them into its own rope of commits&lt;/li&gt;
&lt;li&gt;Later when you want to, you can add it to the main branch, that is to merge the branch with the main branch &lt;/li&gt;
&lt;li&gt;You can make as many branches as you want&lt;/li&gt;
&lt;li&gt;But merging branches with lot of changes and commits is an advanced topic!&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  GitHub (Pushing/Pulling)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Although git is helping save our projects's history, the history of our project is still living on our hard disk&lt;/li&gt;
&lt;li&gt;If we loose it then bang!&lt;/li&gt;
&lt;li&gt;And if someone else wants to collaborate with us on the project,
they don't have access to our repo on our pc &lt;/li&gt;
&lt;li&gt;To solve these issues, we have &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;, a repo hosting platform, where we can save our repo history&lt;/li&gt;
&lt;li&gt;When you make new commits you send them to github that is to push changes up!&lt;/li&gt;
&lt;li&gt;Anyone having access to your github repo can send their changes (commits) to the repo on github and we can get or pull those changes back to our local pc repo&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Usual Flow of Commands
&lt;/h2&gt;

&lt;p&gt;1) Initialize a git repo&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2) Check status&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3) Add changes to the staging area (just a fancy term, you know what it does)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add specific_file.something specific_file2.something ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4) Save changes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"My first commit with changes"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5) Checking and pulling new changes from GitHub&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git pull
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;6) Pushing changes to GitHub&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;7) See the history&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Caution For Beginners
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;While using the command: &lt;code&gt;git add .&lt;/code&gt;, git tracks &lt;strong&gt;everything in you repo folder&lt;/strong&gt; including any &lt;strong&gt;sensitive information&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;And when you push it to GitHub, if its a public repo, then the whole world can get access to that information&lt;/li&gt;
&lt;li&gt;So, do not put any sensitive information like passwords, tokens, api keys etc in your repo!&lt;/li&gt;
&lt;li&gt;And mostly use &lt;code&gt;git add&lt;/code&gt; with &lt;strong&gt;explicit filenames&lt;/strong&gt; rather than "."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; I skipped the topics like: how to setup github account and make repos and add local repo's pushing destination to github repo, etc&lt;br&gt;
Those, I think, you can learn on your own, once you get the basics! &lt;br&gt;
(AI is also there for your help!)&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go from here?
&lt;/h2&gt;

&lt;p&gt;I found this video very helpful while learning:&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=apGV9Kg7ics" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=apGV9Kg7ics&lt;/a&gt;&lt;br&gt;
And the official git book:&lt;br&gt;
&lt;a href="https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control" rel="noopener noreferrer"&gt;https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Hello World in Neutralinojs</title>
      <dc:creator>csm</dc:creator>
      <pubDate>Sun, 07 Dec 2025 23:29:56 +0000</pubDate>
      <link>https://dev.to/csm18/hello-world-in-neutralinojs-4e99</link>
      <guid>https://dev.to/csm18/hello-world-in-neutralinojs-4e99</guid>
      <description>&lt;h2&gt;
  
  
  About
&lt;/h2&gt;

&lt;p&gt;A lightweight gui framework for desktop gui app development.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://neutralino.js.org/" rel="noopener noreferrer"&gt;link to website&lt;/a&gt;&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Simple&lt;/li&gt;
&lt;li&gt;Lightweight&lt;/li&gt;
&lt;li&gt;Crossplatform&lt;/li&gt;
&lt;li&gt;Web technologies for ui coding&lt;/li&gt;
&lt;li&gt;Can use any front-end frameworks&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Development Environment
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;os: linux mint&lt;/li&gt;
&lt;li&gt;code-editor: vscode&lt;/li&gt;
&lt;li&gt;node.js (I use bun!)&lt;/li&gt;
&lt;li&gt;neutralinojs &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hello World App
&lt;/h2&gt;

&lt;p&gt;1.Installing neu(cli tool for neutralinojs) tool:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g @neutralinojs/neu

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Creating a new project(or &lt;strong&gt;neu&lt;/strong&gt; project 😉):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;neu create hello

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd hello
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.Test run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;neu run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see a simple app!&lt;/p&gt;

&lt;p&gt;4.Project structure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There are a bunch of files and folders!&lt;/li&gt;
&lt;li&gt;neutralino.config.json is for configuration like we can set the size of the main window, etc.&lt;/li&gt;
&lt;li&gt;bin/ folder contains neutralino binaries&lt;/li&gt;
&lt;li&gt;resources/ folder is where our code lives!&lt;/li&gt;
&lt;li&gt;dist/ folder (is generated after we build the project) is where our end app lives!&lt;/li&gt;
&lt;li&gt;So,when user downloads our app,he gets a folder with binaries for different platforms and a resources.neu file.&lt;/li&gt;
&lt;li&gt;The user double clicks the binary for his specific platform(like hello-linux_x64) and the executable will start the app by loading our ui code that was packaged into resources.neu file.&lt;/li&gt;
&lt;li&gt;Simply, the app means the executable and the resources.neu file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;5.To build the project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;neu build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For release:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;neu build --release

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It produces a zip file in dist/ folder.&lt;/p&gt;

&lt;p&gt;6.Now, making the simple app even simpler!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Delete all the code in resources/index.html
and put this:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Hello World&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/styles.css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"neutralinoapp"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Hello World!&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"/js/neutralino.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="c"&gt;&amp;lt;!-- Your app's source files --&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"/js/main.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the two script tags are important!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now replace the content in styles.css with:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;html&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;And for now just remove all the code in resources/js/main.js (No js for now!)&lt;/li&gt;
&lt;li&gt;Now run the app and see!
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;neu run

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thats it!&lt;/p&gt;

&lt;h2&gt;
  
  
  Task
&lt;/h2&gt;

&lt;p&gt;Find the field in neutralino.config.json, that ends the process when the user closes the main window!&lt;/p&gt;

</description>
      <category>neutralinojs</category>
      <category>desktop</category>
      <category>gui</category>
      <category>web</category>
    </item>
    <item>
      <title>Calculator app using bolt</title>
      <dc:creator>csm</dc:creator>
      <pubDate>Tue, 01 Jul 2025 16:06:47 +0000</pubDate>
      <link>https://dev.to/csm18/calculator-app-using-bolt-3301</link>
      <guid>https://dev.to/csm18/calculator-app-using-bolt-3301</guid>
      <description>&lt;h2&gt;
  
  
  Inspiration
&lt;/h2&gt;

&lt;p&gt;I was amazed to see how ai can write the whole project.So, thought to test it with my pet project!&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;A simple calculator web app that can do basic arithmetic operations.&lt;/p&gt;

&lt;p&gt;The app is live at:&lt;br&gt;
&lt;a href="https://resplendent-belekoy-fa1e99.netlify.app/" rel="noopener noreferrer"&gt;link&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How we built it
&lt;/h2&gt;

&lt;p&gt;I setup a vue app using stackblitz and then imported it into bolt.new.Then, with just one line of prompt and then an auto fix, I got a fully functioning calculator app. The prompt was &lt;strong&gt;first, write a calculator app ui which is responsive&lt;/strong&gt;. Then with one more prompt deployed it to netlify.&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges we ran into
&lt;/h2&gt;

&lt;p&gt;Not really, but just one config error that was auto fixed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Accomplishments that we're proud of
&lt;/h2&gt;

&lt;p&gt;Just got an app up and running what took me months when I got started in dev.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we learned
&lt;/h2&gt;

&lt;p&gt;I think its an amazing tool that is very useful for fast prototyping.&lt;/p&gt;

&lt;p&gt;I know the app is still rough with many things missing but with just one or two prompts this much was possible + got my first hackathon experience!&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>wlhchallenge</category>
      <category>bolt</category>
      <category>ai</category>
    </item>
    <item>
      <title>be careful with return values in go</title>
      <dc:creator>csm</dc:creator>
      <pubDate>Tue, 06 May 2025 13:45:24 +0000</pubDate>
      <link>https://dev.to/csm18/be-careful-with-return-values-in-go-ik4</link>
      <guid>https://dev.to/csm18/be-careful-with-return-values-in-go-ik4</guid>
      <description>&lt;h2&gt;
  
  
  About
&lt;/h2&gt;

&lt;p&gt;I was writing a program in go, where I was calling a function,which takes an existing slice, modifies it and returns it back.Then I had a print statement that prints that slice.&lt;br&gt;
Here, when I printed the slice, I was getting the same old values that were there before the function call.&lt;br&gt;
I was hitting my head to the keyboard to find the cause.&lt;br&gt;
Where did I screw up?&lt;br&gt;
Well, I &lt;strong&gt;did not assign the return value of the function call&lt;/strong&gt;,which is the modified slice,to the old slice variable.In Rust or in some other languages,the compiler will yell at us if we leave the return values of a function call without assigning them.&lt;br&gt;
So the catch is &lt;strong&gt;go compiler will not give an error&lt;/strong&gt; if we leave return values of a function call.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bottom Line
&lt;/h2&gt;

&lt;p&gt;So, always look for the &lt;strong&gt;function signature&lt;/strong&gt; before calling the function.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>good, simple, detailed info and explanation on wifi.</title>
      <dc:creator>csm</dc:creator>
      <pubDate>Sun, 04 May 2025 15:38:06 +0000</pubDate>
      <link>https://dev.to/csm18/good-simple-detailed-info-and-explanation-on-wifi-45c3</link>
      <guid>https://dev.to/csm18/good-simple-detailed-info-and-explanation-on-wifi-45c3</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/h0ag/understanding-wi-fi-wireless-fidelity-4pei" class="crayons-story__hidden-navigation-link"&gt;Understanding Wi-Fi (Wireless Fidelity)&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/h0ag" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3081522%2Fc976b6d5-6a2f-4c49-88c8-0fb5fbe7ff58.jpg" alt="h0ag profile" class="crayons-avatar__image" width="96" height="96"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/h0ag" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Hoag
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Hoag
                
              
              &lt;div id="story-author-preview-content-2455888" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/h0ag" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3081522%2Fc976b6d5-6a2f-4c49-88c8-0fb5fbe7ff58.jpg" class="crayons-avatar__image" alt="" width="96" height="96"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Hoag&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/h0ag/understanding-wi-fi-wireless-fidelity-4pei" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;May 3 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/h0ag/understanding-wi-fi-wireless-fidelity-4pei" id="article-link-2455888"&gt;
          Understanding Wi-Fi (Wireless Fidelity)
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/network"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;network&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/wifi"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;wifi&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/hwiki"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;hwiki&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/h0ag/understanding-wi-fi-wireless-fidelity-4pei" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/fire-f60e7a582391810302117f987b22a8ef04a2fe0df7e3258a5f49332df1cec71e.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;3&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/h0ag/understanding-wi-fi-wireless-fidelity-4pei#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            4 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>network</category>
      <category>wifi</category>
      <category>hwiki</category>
    </item>
    <item>
      <title>Counter web app</title>
      <dc:creator>csm</dc:creator>
      <pubDate>Thu, 01 May 2025 19:14:37 +0000</pubDate>
      <link>https://dev.to/csm18/counter-web-app-27i8</link>
      <guid>https://dev.to/csm18/counter-web-app-27i8</guid>
      <description>&lt;h2&gt;
  
  
  About
&lt;/h2&gt;

&lt;p&gt;A simple counter app using html,css,js and go(for backend).&lt;/p&gt;

&lt;h2&gt;
  
  
  Link to repo:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/csm-18/counter-web-app" rel="noopener noreferrer"&gt;link to repo&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;We serve the frontend using go's http server package.&lt;br&gt;
It serves the index.html with the assets on "&lt;a href="http://localhost:8080" rel="noopener noreferrer"&gt;http://localhost:8080&lt;/a&gt;".&lt;br&gt;
We open the url in the browser and we get the app.&lt;/p&gt;
&lt;h2&gt;
  
  
  How app works
&lt;/h2&gt;

&lt;p&gt;1.If we click the '+' button, it increments the counter.&lt;br&gt;
2.If we click the '-' button, it decrements the counter.&lt;br&gt;
3.If we click on the counter number, it resets the counter(🛑 be careful! 🛑).&lt;/p&gt;
&lt;h2&gt;
  
  
  Project structure
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fc6wi5480rf7ih3rt746l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fc6wi5480rf7ih3rt746l.png" alt="project structure" width="280" height="235"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Steps
&lt;/h2&gt;

&lt;p&gt;1.Create project directory: counter-web-app.&lt;br&gt;
2.cd into it.&lt;br&gt;
3.run: &lt;code&gt;go mod init counter&lt;/code&gt;&lt;br&gt;
Here,we are initialising go module with name &lt;em&gt;counter&lt;/em&gt;.&lt;br&gt;
4.run: &lt;code&gt;touch counter.go&lt;/code&gt;&lt;br&gt;
This file is the entry point to the http server that serves our web app.&lt;br&gt;
5.Fill &lt;code&gt;counter.go&lt;/code&gt; with the below lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"fmt"&lt;/span&gt;
    &lt;span class="s"&gt;"net/http"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;fs&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FileServer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Dir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"./public/"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Handle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Server is running on http://localhost:8080"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ListenAndServe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;":8080"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;br&gt;
1) main() function is the entry point.&lt;br&gt;
2) This line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;fs&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FileServer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Dir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"./public/"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creates a file server that serves the public folder.&lt;br&gt;
3) This line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Handle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sets the default url to public folder, so that when a user accesses the website,it serves the &lt;code&gt;index.html&lt;/code&gt; file in the public folder.&lt;br&gt;
4) Last line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ListenAndServe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;":8080"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Serves the app on "&lt;a href="http://localhost:8080" rel="noopener noreferrer"&gt;http://localhost:8080&lt;/a&gt;".&lt;/p&gt;

&lt;p&gt;6.Create directory 'public'(for frontend code):&lt;br&gt;
&lt;code&gt;mkdir public&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;7.Create three files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch public/index.html public/index.js public/styles.css
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;8.Fill the 'index.html' file with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Counter&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"styles.css"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"index.js"&lt;/span&gt; &lt;span class="na"&gt;defer&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"counter-container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"counter-contents"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Counter&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"counter-btn"&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"incrementCounter()"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;+&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt;
          &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"counter-value"&lt;/span&gt;
          &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"text-align: center"&lt;/span&gt;
          &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"resetCounter()"&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;0&lt;span class="nt"&gt;&amp;lt;/span&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"counter-btn"&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"decrementCounter()"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;-&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;br&gt;
1) In the head:&lt;br&gt;
-&amp;gt; We set the title to 'Counter'.&lt;br&gt;
-&amp;gt; We link the css style sheet 'styles.css'.&lt;br&gt;
-&amp;gt; We link the js script 'index.js'(with the &lt;strong&gt;defer&lt;/strong&gt; attribute).&lt;br&gt;
2) In the body:&lt;br&gt;
-&amp;gt; We need 2 buttons for '+' and '-' and a &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt; element for holding the counter value.&lt;br&gt;
-&amp;gt; But to align them correctly we put them inside two div elements for using flex box.&lt;br&gt;
-&amp;gt; And also an h1 heading saying "Counter".&lt;/p&gt;

&lt;p&gt;9.Now, css!&lt;br&gt;
Fill the 'styles.css' file with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;40px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;20px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.counter-container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.counter-contents&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;gap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;30px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#e2af39&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/* #e2af39 */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nc"&gt;.counter-btn&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#dd6036&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;6rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;3rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1rem&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;2rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;pointer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;#counter-value&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;min-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;pointer&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;br&gt;
1) We make the counter-container div flex and move it to center.&lt;br&gt;
2) We make the counter-contents div flex and set the flex direction to 'column', so that it aligns the items vertically.&lt;br&gt;
3) And the rest is normal styling!&lt;/p&gt;

&lt;p&gt;10.Finally, js!&lt;br&gt;
Fill the 'index.js' file with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;incrementCounter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;counter-value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;parseInt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;counter-value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;decrementCounter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;counter-value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;parseInt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;counter-value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;resetCounter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;counter-value&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;br&gt;
We have three functions:&lt;br&gt;
1) incrementCounter() -&amp;gt; that increments the counter when user clicks '+' button.&lt;br&gt;
2) decrementCounter() -&amp;gt; that decrements the counter when user clicks '-' button.&lt;br&gt;
3) resetCounter() -&amp;gt; that resets the counter value to 0,when user clicks the counter number (&lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt;). &lt;/p&gt;

&lt;p&gt;11.Now, all is set!&lt;br&gt;
Just run: &lt;code&gt;go run .&lt;/code&gt;&lt;br&gt;
and open the browser with the given url.&lt;br&gt;
12.Done!&lt;/p&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>javascript</category>
      <category>go</category>
    </item>
    <item>
      <title>taking input with spaces in go</title>
      <dc:creator>csm</dc:creator>
      <pubDate>Tue, 03 Dec 2024 05:46:54 +0000</pubDate>
      <link>https://dev.to/csm18/taking-input-with-spaces-in-go-19p4</link>
      <guid>https://dev.to/csm18/taking-input-with-spaces-in-go-19p4</guid>
      <description>&lt;h2&gt;
  
  
  Context
&lt;/h2&gt;

&lt;p&gt;I was writing a calculator program which asks user for input expression and prints the result and prompts again for next expression.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem
&lt;/h2&gt;

&lt;p&gt;But, when I used fmt.Scanln() for reading a line(with space-chars like space and tab), the thing happened!&lt;/p&gt;

&lt;p&gt;It stopped reading when it encountered a space-char(yep! not a newline but space char).&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
 Input: 2 +3.5(5)&lt;br&gt;
 Got: 2&lt;/p&gt;

&lt;p&gt;But, I got even worse thing to say!&lt;br&gt;&lt;br&gt;
The rest of the chars in the input were still there and if we call the Scanln() func again, it reads them.&lt;/p&gt;
&lt;h2&gt;
  
  
  Solution:
&lt;/h2&gt;

&lt;p&gt;There is another func called Scanf() in fmt package.&lt;br&gt;
This guy is different!&lt;br&gt;
It takes input based on format specifiers and stores them in variables we gave.&lt;br&gt;
Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;    &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt;

    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Enter expression:"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;temp&lt;/span&gt; &lt;span class="kt"&gt;rune&lt;/span&gt;
        &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;temp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;temp&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;'\n'&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;temp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"You entered:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt; %v"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;br&gt;
1.Prints "Enter expression:"&lt;br&gt;
2.a loop starts&lt;br&gt;
3.Now, the loop takes input from user, char by char(rune by rune in go)&lt;br&gt;
5.And in each iteration, we take that rune and add it or append it to our text variable.&lt;br&gt;
6.When it reads a '\n', then it breaks the loop and we get the input-line inside &lt;strong&gt;text&lt;/strong&gt; variable.&lt;br&gt;
7.Here, rune can also be &lt;strong&gt;space chars&lt;/strong&gt;.&lt;br&gt;
So, literally it reads even the '\n'.&lt;/p&gt;

&lt;p&gt;(Reading space chars is an exception for Scanf("%c",&amp;amp;var_name) and is what we want!)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: It also solves the problem we get when we read more than one line.I mean, we get unexpected input or behaviour when we read more than one line(I don't know the exact reason!).&lt;br&gt;
But here, since we are reading char by char, including '\n' as well(into the temp var), will eliminate all those errors!&lt;/p&gt;
&lt;h2&gt;
  
  
  Custom readline() func
&lt;/h2&gt;

&lt;p&gt;We can write a custom readline() func like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s"&gt;"fmt"&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Enter expression:"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;input&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;readline&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"You entered:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt; %v&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;readline&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;temp&lt;/span&gt; &lt;span class="kt"&gt;rune&lt;/span&gt;
        &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Scanf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;temp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;temp&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sc"&gt;'\n'&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;temp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>go</category>
    </item>
  </channel>
</rss>
