<?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: Jainta Paul</title>
    <description>The latest articles on DEV Community by Jainta Paul (@pauljainta).</description>
    <link>https://dev.to/pauljainta</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F990307%2F03c77fcc-6f06-4c85-80b9-75a871977bcf.jpeg</url>
      <title>DEV Community: Jainta Paul</title>
      <link>https://dev.to/pauljainta</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pauljainta"/>
    <language>en</language>
    <item>
      <title>Golang Building from Source</title>
      <dc:creator>Jainta Paul</dc:creator>
      <pubDate>Wed, 21 Jun 2023 18:56:26 +0000</pubDate>
      <link>https://dev.to/pauljainta/golang-building-from-source-jm6</link>
      <guid>https://dev.to/pauljainta/golang-building-from-source-jm6</guid>
      <description>&lt;p&gt;I have been working on a research project which involves Garbage collection mechanism in Golang. We have successfully built Golang from source code. Now, we are trying to add minor modifications in the source code and see if build succeeds or not. As a starter, we have added a log print  in &lt;code&gt;mgc.go&lt;/code&gt; file  in function &lt;code&gt;gcinit&lt;/code&gt; at the very beginning&lt;/p&gt;

&lt;p&gt;&lt;code&gt;func gcinit() {&lt;br&gt;
    log.Print("In Function GCINT ")&lt;br&gt;
....................................................................................................................&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After adding the log print, the build fails with the following error:&lt;br&gt;
&lt;code&gt;In Function GCINIT &lt;br&gt;
            In Function GCINIT shift.go:12:6: (i8 + 1) (8 bits) too small for shift of 8&lt;br&gt;
FAIL&lt;br&gt;
FAIL    cmd/vet    9.460s&lt;br&gt;
FAIL&lt;br&gt;
go tool dist: Failed: exit status 1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;We have tried to use &lt;code&gt;fmt.printf&lt;/code&gt; but no luck so far. We will be happy if someone can help&lt;/p&gt;

</description>
      <category>go</category>
    </item>
    <item>
      <title>Go Source Code From AST Parser</title>
      <dc:creator>Jainta Paul</dc:creator>
      <pubDate>Wed, 14 Dec 2022 15:20:32 +0000</pubDate>
      <link>https://dev.to/pauljainta/go-source-code-from-ast-parser-20c4</link>
      <guid>https://dev.to/pauljainta/go-source-code-from-ast-parser-20c4</guid>
      <description>&lt;p&gt;I am trying to regenerate source code from ast of a go program. After regenerating the source code, I am trying to match that with the original source code. But the regenerated source code gives some extra spaces in some places of the code. The code is given below.&lt;br&gt;
&lt;code&gt;&lt;br&gt;
fs := token.NewFileSet()&lt;br&gt;
    f, err := parser.ParseFile(fs, filename, nil, parser.ParseComments)&lt;br&gt;
    if err != nil {&lt;br&gt;
        log.Println(err)&lt;br&gt;
    }&lt;br&gt;
cfg := printer.Config{Mode: printer.RawFormat}&lt;br&gt;
    err = cfg.Fprint(&amp;amp;buffer, fs, f)&lt;br&gt;
    if err != nil {&lt;br&gt;
        log.Println(err)&lt;br&gt;
    }&lt;br&gt;
    source_code, err := os.ReadFile(filename)&lt;br&gt;
    if err != nil {&lt;br&gt;
        log.Println(err)&lt;br&gt;
    }&lt;br&gt;
    buffer_source_code := buffer.String()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Can someone help me what should I do to get the exact source code as the original from a ast?&lt;/p&gt;

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