Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

refactor: use constants for OSs#448

Merged
greyscaled merged 1 commit intomainfromvapurrmaid/rfr-os-consts
Sep 28, 2021
Merged

Conversation

greyscaled
Copy link
Contributor

@greyscaledgreyscaled commentedSep 24, 2021
edited
Loading

@coveralls
Copy link

coveralls commentedSep 24, 2021
edited
Loading

Pull Request Test Coverage Report forBuild 1268223903

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 1 of3(33.33%) changed or added relevant lines in2 files are covered.
  • 2 unchanged lines in1 file lost coverage.
  • Overall coverage decreased (-0.03%) to48.014%

Changes Missing CoverageCovered LinesChanged/Added Lines%
internal/cmd/configssh.go020.0%
Files with Coverage ReductionNew Missed Lines%
wsnet/dial.go278.02%
TotalsCoverage Status
Change from baseBuild 1237802265:-0.03%
Covered Lines:2816
Relevant Lines:5865

💛 -Coveralls

@greyscaledgreyscaled self-assigned thisSep 24, 2021
@arminaakiarminaaki mentioned this pull requestSep 24, 2021
@@ -36,6 +36,7 @@ import (
const (
goosWindows = "windows"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It's unfortunate that Go doesn't seem to offer these constants in their code anywhere. It looks like Go themselves use hardcoded string comparisons everywhere:https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/golang/go%24+%22windows%22&patternType=literal -- given that, maybe it's okay for us to do that too?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Personally I think that doesn't sit well unless at least a type (like TS union of strings as a type alias) is defined. That feels a bit like walking on quicksand.

I don't know their reason, but I think it's reasonable we reach for them in our own domain model/application code base. I'd expect there to be some concept of a constant, enumeration or type in other languages when approaching a similar problem. Go sometimes makes odd choices IMO :P

@greyscaledgreyscaled merged commit7d34771 intomainSep 28, 2021
@greyscaledgreyscaled deleted the vapurrmaid/rfr-os-consts branchSeptember 28, 2021 02:44
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@jawnsyjawnsyjawnsy approved these changes

@f0sself0sself0ssel approved these changes

Assignees

@greyscaledgreyscaled

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@greyscaled@coveralls@jawnsy@f0ssel

[8]ページ先頭

©2009-2025 Movatter.jp