Re: [go-nuts] Any information about adding a trailing comma in ast CompositeLit (for structs)

2022-10-24 Thread Tajmeet Singh
: https://github.com/tjgurwara99/constr/blob/0e0f8952c652b7a7a10b7238daed90132b924084/construct.go#L31 On Tuesday, 25 October 2022 at 01:07:23 UTC+1 david@gmail.com wrote: > On Sat, Oct 22, 2022 at 10:00 PM Tajmeet Singh wrote: > >> Hello, >> >> I've been wor

[go-nuts] Any information about adding a trailing comma in ast CompositeLit (for structs)

2022-10-22 Thread Tajmeet Singh
Hello, I've been working on a utility to generate constructors for me when I provide it with a path to the file containing the struct and it `Ident`. The idea was that I would just create a ast.Node (FuncDecl) with all the necessary fields but I'm not able to figure out the positioning of the

Re: [go-nuts] Anonymous function with Generic type parameters?

2022-02-16 Thread Tajmeet Singh
at 4:22 PM Tajmeet Singh wrote: > > > > I have been experimenting with the generics code for a bit and I came > across a situation here I wanted to use a generic func as a type > > > > Consider the following: > > > > I have a few sort functions which I want

[go-nuts] Anonymous function with Generic type parameters?

2022-02-16 Thread Tajmeet Singh
I have been experimenting with the generics code for a bit and I came across a situation here I wanted to use a generic func as a type Consider the following: I have a few sort functions which I want to use for testing and profiling, for this I use something like this var sortFuncs = []struct

[go-nuts] Re: AST: Understanding the differences between functions and methods

2021-09-18 Thread Tajmeet Singh
Oh yes! Thank you so much :) On Saturday, 18 September 2021 at 19:23:17 UTC+1 seank...@gmail.com wrote: > I believe the Recv field does what you want? > > On Saturday, September 18, 2021 at 8:20:19 PM UTC+2 tjgur...@gmail.com > wrote: > >> Hi, >> >> I was working on a tool for internal use where

[go-nuts] AST: Understanding the differences between functions and methods

2021-09-18 Thread Tajmeet Singh
Hi, I was working on a tool for internal use where I had to work with the go's abstract syntax tree specially with the FuncDecls. I wanted to filter the ast to only function declarations without methods. I was wondering if there is a way to distinguish between normal functions and structure met

[go-nuts] Re: Does go:embed embed.FS embeds directories or possible confusion with how it works

2021-07-09 Thread Tajmeet Singh
Ah okay, thanks seank. I was missing the fact that we can embed multiple files by specifying multiple patterns and assign it to a single `embed.FS`. Now it all makes sense. Thanks! On Monday, 5 July 2021 at 20:56:28 UTC+1 seank...@gmail.com wrote: > `embed` embeds the files with the path you sp

[go-nuts] Does go:embed embed.FS embeds directories or possible confusion with how it works

2021-07-04 Thread Tajmeet Singh
Hi there, I have been testing the (relatively) new go:embed feature for a few days and I came across this situation which I wasn't quite sure what was causing it so I thought asking here would help. Consider the following code: ```golang package main import ( "embed" "fmt" "log" "net/http" )