보관함

vscode emmet 설정

dotnet 의 cshtml 에서 emmet 를 사용할때 어떨때는 되고 어떨때는 되지 않는 문제 발생

내가 제대로 못쓰는줄 알고 그려려니 하고 사용했었으나…

vscode 의 환경에

"emmet.includeLanguages": {
	"razor":"html",
	"aspnetcorerazor": "html",
	"asp": "html",
},

추가로 그 뒤로는 emmet 가 잘 되는 것 확인

vscode go Example실행

프로젝트용 폴더 생성

main.go 파일 생성

package main
import "fmt"
func main() {
	fmt.Println("hello world")
}

vscode 로 폴더 열기

F5 로 실행 -> Error

dlv 파일이 없어서 생긴 문제 인것 같아서 일단 delve 패키지 install

brew install delve

하지만 

go: go.mod file not found in current directory or any parent directory; see 'go help modules'

터미널에서

go env -w GO111MODULE=auto

F5 로 실행 및 디버깅

그리고 vscode의 환경설정에 아래 코드 추가

"go.toolsManagement.autoUpdate": true,

 

 

csharp 몇몇 코드 단순화

in 매개 변수

// 여기서의 in은 ref readonly처럼 작동함 함수 call시에는 in을 쓰거나 말거나 동일
void PrintDate(in DateTime date)
{
    Console.WriteLine(date);
}

null 관련 연산자

// 오래전
instance = instance == null ? value : instance;

// 기존
instance = instance ?? value;

// 현재
instance ??= value;

Auto Property

// C# 6.0 Auto property
public string Name { get; set; } = "Karu";

Index 연산

// C# 8.0 인덱스 연산
string str = "Rolling Ress";
var last = str[^1]; // 's'
var sub = str[0..4]; // "Roll", 구간은 [0, 4)