profile
viewpoint
Fatih Arslan fatih California, USA https://arslan.io Software Engineer. Gopher and Coffee geek. Creator of vim-go. Tool maker.

fatih/color 3645

Color package for Go (golang)

fatih/gomodifytags 1311

Go tool to modify struct field tags

fatih/pool 1126

Connection pool for Go's net.Conn interface

fatih/dotfiles 514

My personal dotfiles

fatih/errwrap 307

Go tool to wrap and fix errors with the new %w verb directive

fatih/hclfmt 196

Format and prettify HCL files

fatih/molokai 172

Molokai color scheme for Vim

fatih/faillint 167

Report unwanted import path and declaration usages

fatih/motion 162

Navigation and insight in Go

fatih/astrewrite 160

Go tool to walk & rewrite AST

created tagfatih/gomodifytags

tagv1.12.0

Go tool to modify struct field tags

created time in 2 days

release fatih/gomodifytags

v1.12.0

released time in 2 days

push eventfatih/gomodifytags

Fatih Arslan

commit sha dc599fb915809b8962bae424807030668c3ecb90

Add test to detect duplicate flag names

view details

Fatih Arslan

commit sha e4378484bb7b589b5a7621796d1f41cf9f6294cd

Comment the behavior we're testing for

view details

Fatih Arslan

commit sha d4b34d8ade048b1a33d95fefb664bb5abfcca881

Merge pull request #75 from fatih/fatih/test-for-flag-redefinitions Add test to detect duplicate flag names

view details

push time in 2 days

PR merged fatih/gomodifytags

Add test to detect duplicate flag names

This makes sure we never see issues like https://github.com/fatih/gomodifytags/pull/74

cc @perrito666

+59 -32

3 comments

2 changed files

fatih

pr closed time in 2 days

pull request commentfatih/gomodifytags

Add test to detect duplicate flag names

@perrito666 good call, added more comments.

fatih

comment created time in 4 days

push eventfatih/gomodifytags

Fatih Arslan

commit sha e4378484bb7b589b5a7621796d1f41cf9f6294cd

Comment the behavior we're testing for

view details

push time in 4 days

PR opened fatih/gomodifytags

Add test to detect duplicate flag names

This makes sure we never see issues like https://github.com/fatih/gomodifytags/pull/74

cc @perrito666

+57 -32

0 comment

2 changed files

pr created time in 4 days

create barnchfatih/gomodifytags

branch : fatih/test-for-flag-redefinitions

created branch time in 4 days

created tagfatih/gomodifytags

tagv1.11.0

Go tool to modify struct field tags

created time in 5 days

release fatih/gomodifytags

v1.11.0

released time in 5 days

pull request commentfatih/gomodifytags

Rename `format` to `template` to avoid clash

No worries, I also didn't saw it. Thanks for the fix 👍🏼

perrito666

comment created time in 5 days

push eventfatih/gomodifytags

Horacio Duran

commit sha 5d506089b43f0f998c69d3843fce05ca81d737ab

Rename `format` to `template` to avoid clash

view details

Fatih Arslan

commit sha 66ed821d63226f2c1ca875d5c3acd117fb73311e

Merge pull request #74 from perrito666/add_prefix_to_column_name_tag Rename `format` to `template` to avoid clash

view details

push time in 5 days

PR merged fatih/gomodifytags

Rename `format` to `template` to avoid clash

When I applied the last change it all checked out and tests passed but I missed that format was shadowed by another flag used currently to signal the type of output, apologies @fatih I just realized when doing the changes to the vscode plug in to integrate this.

+3 -3

0 comment

2 changed files

perrito666

pr closed time in 5 days

push eventfatih/color

Fatih Arslan

commit sha 83e32ed621e7aaa94cecc2e1bbc219cc18cf6081

Update Go version

view details

Fatih Arslan

commit sha 736d9727306d4329377f5e399f7533114024f782

Merge pull request #113 from fatih/add-gh-actions Update Go version

view details

push time in 5 days

PR merged fatih/color

Update Go version
+3 -3

0 comment

1 changed file

fatih

pr closed time in 5 days

PR opened fatih/color

Update Go version
+3 -3

0 comment

1 changed file

pr created time in 5 days

create barnchfatih/color

branch : add-gh-actions

created branch time in 5 days

push eventfatih/color

Fatih Arslan

commit sha 8023da8cd92be31d234b134e1560ccfa24c54807

Add new banner & badges, remove archived message

view details

push time in 5 days

push eventfatih/gomodifytags

Fatih Arslan

commit sha 45c5830e730f0f49930d2448ebfa3199300d9a76

Couple of readme and typo improvements.

view details

push time in 5 days

created tagfatih/gomodifytags

tagv1.10.0

Go tool to modify struct field tags

created time in 5 days

release fatih/gomodifytags

v1.10.0

released time in 5 days

issue closedfatih/gomodifytags

Add a mechanism to prefix tags

Some libraries like the gorm ORM or the gaum SQL query builder use a prefix in the tag name (ie gorm:"column:struct_field", gaum:"field_name=struct_field") to help ther Scanner/Valuer interact with the sql library in go.

I proposed a way to do this in this Pull Request

closed time in 5 days

perrito666

issue commentfatih/gomodifytags

Add a mechanism to prefix tags

Fixed with https://github.com/fatih/gomodifytags/pull/69

perrito666

comment created time in 5 days

pull request commentfatih/gomodifytags

New Add/Remove prefix option

Thanks a lot @perrito666 for going over this PR and making sure everything is up to date.

perrito666

comment created time in 5 days

push eventfatih/gomodifytags

Horacio Duran

commit sha 128b480f444278d5ecb9bf5cd9bb73e7cfb06083

New Add/Remove prefix option (#69) * New Add/Remove prefix option Some libraries like [the gorm ORM](https://github.com/go-gorm/gorm) or the [gaum SQL query builder](https://github.com/shiftleftsecurity/gaum) use a prefix in the tag name (ie `gorm:"column:struct_field"`, gaum:"field_name=struct_field") to help ther Scanner/Valuer interact with the sql library in go. This PR adds the ability to add and remove said prefixes. I used these two libraries as samples in the tests files to help understand the rationale behind said feature to people reading without context, hopefully this doesn't break any project convention. * Add Readme section for prefix * Replaced prefix with format * Update main.go Accepting fatih's suggestion on flag doc Co-authored-by: Fatih Arslan <fatih@github.com> * Update README.md Accepting fatih's suggestion on `format` flag Co-authored-by: Fatih Arslan <fatih@github.com> * Update README.md Accepting fatih's suggestion on readme secion title Co-authored-by: Fatih Arslan <fatih@github.com> * Rename formatting var to valueFormat * Rename $value to $field for clarity * Update readme too Co-authored-by: Fatih Arslan <fatih@github.com>

view details

push time in 5 days

PR merged fatih/gomodifytags

New Add/Remove prefix option

Some libraries like the gorm ORM or the gaum SQL query builder use a prefix in the tag name (ie gorm:"column:struct_field", gaum:"field_name=struct_field") to help ther Scanner/Valuer interact with the sql library in go. This PR adds the ability to add and remove said prefixes. I used these two libraries as samples in the tests files to help understand the rationale behind said feature to people reading without context, hopefully this doesn't break any project convention.

+75 -0

4 comments

7 changed files

perrito666

pr closed time in 5 days

PullRequestReviewEvent

Pull request review commentfatih/gomodifytags

New Add/Remove prefix option

 func (c *config) addTags(fieldName string, tags *structtag.Tags) (*structtag.Tag 		unknown = true 	} +	if c.valueFormat != "" {+		name = strings.ReplaceAll(c.valueFormat, "$value", name)

What do you think of renaming $value to $field? Because this will be used to create a new value, but it indicates the field name. I think it's better and easier that way.

perrito666

comment created time in 7 days

PullRequestReviewEvent

Pull request review commentfatih/gomodifytags

New Add/Remove prefix option

 type Server struct { } ``` +### Formatting tags
### Formatting tag values
perrito666

comment created time in 7 days

Pull request review commentfatih/gomodifytags

New Add/Remove prefix option

 type Server struct { } ``` +### Formatting tags++Certain not so up to spec uses of tags might require to them to have a particular formatting, such+as is the case of prefixing them (`field_name=<yourtag>`) the `--format` flag allows you to specify+a format for the tag value to be applied.
By default a struct tag's value is transformed from a struct's field and used directly. As an example for the field `Server string`, we generate a tag in the form: `json:"server"` (assuming `-add-tags=json` is used).

However, some third party libraries use tags in a different way and might require to them to have a particular formatting, such as is the case of prefixing them (`field_name=<your_value>`). The `--format` flag allows you to specify a custom format for the tag value to be applied.
perrito666

comment created time in 7 days

Pull request review commentfatih/gomodifytags

New Add/Remove prefix option

 func realMain() error { 		flagSort = flag.Bool("sort", false, 			"Sort sorts the tags in increasing order according to the key name") +		// formatting+		flagFormatting = flag.String("format", "",+			"Format the given key. i.e: \"column:$value\", \"field_name=$value\"")
			"Format the given tag's value. i.e: \"column:$value\", \"field_name=$value\"")
perrito666

comment created time in 7 days

Pull request review commentfatih/gomodifytags

New Add/Remove prefix option

 type config struct {  	transform   string 	sort        bool+	formatting  string

I think valueFormat is a better name as this indicates the formatting of a struct tag value.

perrito666

comment created time in 7 days

PullRequestReviewEvent
PullRequestReviewEvent

delete branch fatih/gomodifytags

delete branch : add-all-flag

delete time in 7 days

delete branch fatih/gomodifytags

delete branch : fatih/remove-vendor

delete time in 7 days

pull request commentfatih/gomodifytags

New Add/Remove prefix option

Hi @perrito666

Thanks for opening this PR. Even though I can understand that this is useful, this syntax is not an official struct tag definition. Here is a breakdown of a struct tag:

image

And let's decompose it:

As you see, gomodifytags only deals with the value part and the option part which is not even part of the spec. But because it's widely used in stdlib, it's supported. All this is done under the hood via https://github.com/fatih/structtag which also implements the spec and contains the parse logic.

Because of that, I don't want to add additional support for un-official protocols. You should still be able to add various tags, but you need to do it yourself.


Second, I think we can approach this problem from a different perspective. There are many ways to add tags. In fact -add-tags goes over a transformation function and it outputs a different value for different set of flags. These are listed here: https://github.com/fatih/gomodifytags#transformations Below you can see the current set of options:

Screenshot-2020-10-19-23 43 59@2x

What if we add a flag to change the final struct value ? As an example, we could add a very simple templating option which would fix your issue by passing a custom string. The benefit of this is that it's extensible and you will not embed custom un-official logic. Here is what I have in my mind (those are the same examples in this PR):

$ gomodifytags -file demo.go -all -add-tags gaum -transform camelcase -template 'field_name=$value'
package main

type Server struct {
        Name       string `gaum:"field_name=name"`
        Port       int    `gaum:"field_name=port"`
        EnableLogs bool   `gaum:"field_name=enableLogs"`
        BaseDomain string `gaum:"field_name=baseDomain"`
}
$ gomodifytags -file demo.go -all -add-tags gorm -transform camelcase -template 'column:$value'
package main

type Server struct {
        Name       string `gorm:"column:name"`
        Port       int    `gorm:"column:port"`
        EnableLogs bool   `gorm:"column:enableLogs"`
        BaseDomain string `gorm:"column:baseDomain"`
}

Here, the $value is the transformed final value. Once the field name is transformed, you can then use the -template flag and substitute it in any way. The flag names, such as --template, etc.. are not final yet of course and those might change. I pushed a working example branch so you can take a look at it: https://github.com/fatih/gomodifytags/compare/fatih/experiment-value-func

perrito666

comment created time in 7 days

create barnchfatih/gomodifytags

branch : fatih/experiment-value-func

created branch time in 7 days

starteddgryski/semgrep-go

started time in 11 days

startedhashicorp/waypoint

started time in 12 days

delete branch fatih/gomodifytags

delete branch : fatih-patch-1

delete time in 15 days

push eventfatih/gomodifytags

Fatih Arslan

commit sha 641c8f4ad12d080f3a04a61ca75d149a1b83d877

Create codeql-analysis.yml

view details

Fatih Arslan

commit sha bdb461ef089fa1f109bae69956e3881e60c704ea

Merge pull request #72 from fatih/fatih-patch-1 Create codeql-analysis.yml

view details

push time in 15 days

PR merged fatih/gomodifytags

Create codeql-analysis.yml
+63 -0

0 comment

1 changed file

fatih

pr closed time in 15 days

PR opened fatih/gomodifytags

Create codeql-analysis.yml
+63 -0

0 comment

1 changed file

pr created time in 15 days

create barnchfatih/gomodifytags

branch : fatih-patch-1

created branch time in 15 days

created tagfatih/gomodifytags

tagv1.9.0

Go tool to modify struct field tags

created time in 15 days

release fatih/gomodifytags

v1.9.0

released time in 15 days

push eventfatih/gomodifytags

Fatih Arslan

commit sha f833af64d3b6863b5308a365e65b5115544dc701

Remove vendor folder, update CI Go version to 1.15

view details

Fatih Arslan

commit sha 9ad6f3e1a33f73a29de9afa610d3708a126c9cb4

Merge pull request #71 from fatih/fatih/remove-vendor Remove vendor folder, update CI Go version to 1.15

view details

push time in 15 days

create barnchfatih/gomodifytags

branch : fatih/remove-vendor

created branch time in 15 days

created tagfatih/gomodifytags

tagv1.8.0

Go tool to modify struct field tags

created time in 15 days

release fatih/gomodifytags

v1.8.0

released time in 15 days

delete branch fatih/gomodifytags

delete branch : dependabot/go_modules/github.com/fatih/structtag-1.2.0

delete time in 15 days

push eventfatih/gomodifytags

dependabot[bot]

commit sha da2dbd709a927de172396048a2b62fad7a3ba05b

Bump github.com/fatih/structtag from 1.0.0 to 1.2.0 Bumps [github.com/fatih/structtag](https://github.com/fatih/structtag) from 1.0.0 to 1.2.0. - [Release notes](https://github.com/fatih/structtag/releases) - [Commits](https://github.com/fatih/structtag/compare/v1.0.0...v1.2.0) Signed-off-by: dependabot[bot] <support@github.com>

view details

Fatih Arslan

commit sha 369b9768b435f96c21704e4c0cb375ce2b04c785

Merge pull request #70 from fatih/dependabot/go_modules/github.com/fatih/structtag-1.2.0 Bump github.com/fatih/structtag from 1.0.0 to 1.2.0

view details

push time in 15 days

PR merged fatih/gomodifytags

Bump github.com/fatih/structtag from 1.0.0 to 1.2.0 dependencies

Bumps github.com/fatih/structtag from 1.0.0 to 1.2.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/fatih/structtag/releases">github.com/fatih/structtag's releases</a>.</em></p> <blockquote> <h2>v1.2.0</h2> <p>Ignore trailing whitespace: <a href="https://github-redirect.dependabot.com/fatih/structtag/pull/9">fatih/structtag#9</a></p> <h2>v1.1.0</h2> <p>Fixed printing of escaped quotes: <a href="https://github.com/fatih/structtag/commit/3878f9fb88e63e26ea1e6c97ab985cb55452fee5">https://github.com/fatih/structtag/commit/3878f9fb88e63e26ea1e6c97ab985cb55452fee5</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/fatih/structtag/commit/72c94723f1e6825195e0d8e9857fca28cd23d835"><code>72c9472</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/fatih/structtag/issues/9">#9</a> from stephens2424/master</li> <li><a href="https://github.com/fatih/structtag/commit/3eca0a03489882915d559a01a2aac348df48c1aa"><code>3eca0a0</code></a> ignoring trailing whitespace. fixes <a href="https://github-redirect.dependabot.com/fatih/structtag/issues/8">#8</a></li> <li><a href="https://github.com/fatih/structtag/commit/3878f9fb88e63e26ea1e6c97ab985cb55452fee5"><code>3878f9f</code></a> tags: fix escaped quotes</li> <li><a href="https://github.com/fatih/structtag/commit/2fe445299c371fba45da38dc2c786a80299575e4"><code>2fe4452</code></a> Remove funding</li> <li><a href="https://github.com/fatih/structtag/commit/ad7e1d8d17b4c4e751d0c323ea288cbf384adf7b"><code>ad7e1d8</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/fatih/structtag/issues/4">#4</a> from fatih/updates</li> <li><a href="https://github.com/fatih/structtag/commit/5bebde02ccf3db368eca02071c80438529420e02"><code>5bebde0</code></a> Add go.mod, update travis, enable GH actions</li> <li><a href="https://github.com/fatih/structtag/commit/1c659cf57c3263125ad165d8648ddc27fa68c385"><code>1c659cf</code></a> Create FUNDING.yml</li> <li>See full diff in <a href="https://github.com/fatih/structtag/compare/v1.0.0...v1.2.0">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

+3 -3

0 comment

2 changed files

dependabot[bot]

pr closed time in 15 days

push eventfatih/gomodifytags

Fatih Arslan

commit sha 9c95f3e97210c75152b80d2492629f7313f745a0

Create dependabot.yml

view details

push time in 15 days

push eventfatih/camelcase

Fatih Arslan

commit sha 556ff7492a5951b9959f0b2bec76cfbd62d0f176

We don't need to enforce any version

view details

push time in 18 days

push eventfatih/camelcase

Fatih Arslan

commit sha a18ca70d22932816037d1424961f9c5be890eefb

Use GitHub Actions

view details

Fatih Arslan

commit sha 3e995236d54c33e2c948fdee581009b08912cb6e

Update README.md, add go.mod

view details

Fatih Arslan

commit sha 8950a555fed18cbd80bbd0a6aa08c7fcca340021

Go is better

view details

Fatih Arslan

commit sha 193e173c1f495145e3a7a76625225a48178166dc

Merge pull request #3 from fatih/faith/update-ci Use GitHub Actions

view details

push time in 18 days

PR merged fatih/camelcase

Use GitHub Actions
+30 -13

0 comment

4 changed files

fatih

pr closed time in 18 days

push eventfatih/camelcase

Fatih Arslan

commit sha 8950a555fed18cbd80bbd0a6aa08c7fcca340021

Go is better

view details

push time in 18 days

push eventfatih/camelcase

Fatih Arslan

commit sha 3e995236d54c33e2c948fdee581009b08912cb6e

Update README.md, add go.mod

view details

push time in 18 days

PR opened fatih/camelcase

Use GitHub Actions
+25 -3

0 comment

2 changed files

pr created time in 18 days

create barnchfatih/camelcase

branch : faith/update-ci

created branch time in 18 days

startedquasilyte/go-ruleguard

started time in 18 days

issue commentfatih/faillint

Analyse go files with buildtags

Hi @pracucci,

Sorry for the late response. The last couple of months were busy/crazy for me and I took it slow. I should have responded earlier. Thanks for pinging back!

I created this simple file:

// +build requires_docker

package main

import "errors"

func main() {
	_ = errors.New("foo")
}

This command works fine:

$ faillint -paths errors demo.go
/Users/fatih/Code/demo/demo.go:5:8: package "errors" shouldn't be imported

However specifying the package/dir won't work as you said:

$ faillint -paths errors .
-: build constraints exclude all Go files in /Users/fatih/Code/demo
faillint: error during loading

One way of using build tags is passing the GOFLAGS env:

$ GOFLAGS="-tags=requires_docker" faillint -paths errors .
/Users/fatih/Code/demo/demo.go:5:8: package "errors" shouldn't be imported

I didn't see a way to pass a set of tags to the build context via the go/analysis framework. I'll let you know if I've found something.

pracucci

comment created time in 23 days

issue closedfatih/gomodifytags

Support custom tag for selected field in struct

Hi, first thank you for this great library. So i have special case like this, i want to generate custom tag in my Struct, but not all the field will have it. Example

type Pokemon struct {
	Name     string
	Age        int    `validate:min=5,max=10`
}

so on the example above, i only want field Age have the custom tag with value validate:min=5,max=10

Can we have this feature? Thank you for your attention

closed time in 23 days

rezadhah

issue commentfatih/gomodifytags

Support custom tag for selected field in struct

This is now fixed with #68. The v1.7.0 release includes this change: https://github.com/fatih/gomodifytags/releases/tag/v1.7.0

rezadhah

comment created time in 23 days

created tagfatih/gomodifytags

tagv1.7.0

Go tool to modify struct field tags

created time in 23 days

release fatih/gomodifytags

v1.7.0

released time in 23 days

pull request commentfatih/gomodifytags

Adding feature modify tags by struct field name

Thank you @herryg91 for your contribution. I fixed couple of things and merged your changes as well.

herryg91

comment created time in 23 days

push eventfatih/gomodifytags

herry gunawan

commit sha 200139ee8db63019e8fb2562d0e3e1ba7fcccb66

adding featyre modify tags by struct field name

view details

Fatih Arslan

commit sha 2dff190ebf9b4ee819e847dad1c4ee159dbe27f9

Wrap up the PR #68 for adding -field support * Update README * Improve field selection by collecting structs once * Fix the case where multiple fields are on the same line * Fix typos

view details

Fatih Arslan

commit sha 1bc97ea1c01b77cea2e6439332333019bb73112b

Merge pull request #68 from herryg91/add-modify-tags-by-struct-field-name Adding feature modify tags by struct field name

view details

push time in 23 days

PR merged fatih/gomodifytags

Adding feature modify tags by struct field name

Code change for issue https://github.com/fatih/gomodifytags/issues/67

Notes:

  • Adding new feature modify tags by struct field name
  • How to use: gomodifytags -file demo.go -struct Server -field Name -add-tags validate:gt=1
  • Adding -field parameter without -struct will return error
+184 -1

0 comment

15 changed files

herryg91

pr closed time in 23 days

push eventherryg91/gomodifytags

Fatih Arslan

commit sha 2dff190ebf9b4ee819e847dad1c4ee159dbe27f9

Wrap up the PR #68 for adding -field support * Update README * Improve field selection by collecting structs once * Fix the case where multiple fields are on the same line * Fix typos

view details

push time in 23 days

startedWillAbides/go-test2action

started time in a month

PR opened twirp-ecosystem/twirp-opentracing

tracing: add WithContextTags() to define a set of tags based on ctx

This adds a new option to define the tags to be set on the parent span based on the ctx. Most of the time the ctx holds important values, such as request ID's or source IP's that might be useful to set on the span.

+40 -0

0 comment

2 changed files

pr created time in a month

create barnchfatih/twirp-opentracing

branch : fatih/add-context-tags

created branch time in a month

PR opened twirp-ecosystem/twirp-opentracing

tracing: add WithTags() to define default tags

This PR adds the new WithTags TraceOption setting to allow users to define custom tags that will be added by default to each span.

+47 -3

0 comment

2 changed files

pr created time in a month

create barnchfatih/twirp-opentracing

branch : fatih/add-default-tags-options

created branch time in a month

fork fatih/twirp-opentracing

Simple OpenTracing hooks for Twirp

fork in a month

push eventfatih/structtag

Fatih Arslan

commit sha 448f36b472a5fe922c9fc3ece9985aba42019d6b

Update README.md

view details

push time in 2 months

issue commentgolang/go

x/tour: Turkish Go Tour Website is unavailable

I don't have access to the deployment environment, but I know that @roktas and his team were handling it. Not sure if things have changed since then. He'll probably going to respond here, if not I'll make sure to followup with him in other channels.

TalhaK15

comment created time in 2 months

delete branch fatih/shoulda-matchers

delete branch : patch-1

delete time in 2 months

pull request commentthoughtbot/shoulda-matchers

word_wrap: fix Ruby 2.7 warning

Thank you @mcmire

fatih

comment created time in 2 months

push eventfatih/dotfiles

Fatih Arslan

commit sha 09a02fc7732f2316b77cd8b3a80317f59bb6da6d

Ruby on Rails

view details

Fatih Arslan

commit sha d11c4010fc184f09498b98d168ff10f767be0869

Some zshrc improvements

view details

Fatih Arslan

commit sha 5d6537cb2560d56d0120f1d2a2b91b690f907ba7

Make sure to account repos with different default branch names

view details

push time in 2 months

Pull request review commentfatih/gomodifytags

Detect extra cases in struct declarations

 func collectStructs(node ast.Node) map[token.Pos]*structType { 		case *ast.ValueSpec: 			structName = x.Names[0].Name 			t = x.Type+		case *ast.Field:+			if len(x.Names) > 0 {+				structName = x.Names[0].Name+			}+			t = x.Type+		}++		// if found expression is a "*something" or "[]something",+		// dereference to check if "something" contains a struct expression+	loop:+		for true {+			switch x := t.(type) {+			case *ast.StarExpr:+				t = x.X+			case *ast.ArrayType:+				t = x.Elt+			default:+				break loop+			}

I'm not a huge fan of goto's. Can you please change this so it doesn't use this pattern? You can create a small function that would return t

LeGEC

comment created time in 3 months

Pull request review commentfatih/gomodifytags

Added 'Title Case' to the the list of cases

 func realMain() error { 		flagSkipPrivateFields = flag.Bool("skip-unexported", false, "Skip unexported fields") 		flagTransform         = flag.String("transform", "snakecase", 			"Transform adds a transform rule when adding tags."+-				" Current options: [snakecase, camelcase, lispcase, pascalcase, keep]")+				" Current options: [snakecase, camelcase, lispcase, pascalcase, keep, titlecase]")

Can you please add titlecase after pascalcase. Let's keep cases tight together.

anant-barlota

comment created time in 3 months

Pull request review commentfatih/gomodifytags

Added 'Title Case' to the the list of cases

 func (c *config) addTags(fieldName string, tags *structtag.Tags) (*structtag.Tag 		name = strings.Join(titled, "") 	case "keep": 		name = fieldName+	case "titlecase":+		var titled []string+		for _, s := range splitted {+			titled = append(titled, strings.Title(s))+		}++		name = strings.Join(titled, " ")

Can you move this case up, it should come after the other cases.

anant-barlota

comment created time in 3 months

push eventfatih/gomodifytags

Fatih Arslan

commit sha 74aa761c1413c628971394dfbcdb0bd41c9e0fbe

README.md: add headline so linking is easy

view details

push time in 3 months

startedeliben/js-8080-sim

started time in 3 months

more