728x90 반응형 golang26 Go Lang - 확장자 찾는 소스 0.findExt path/filepath 패키지 이용해서 확장자 찾는 소스와 테스트코드 소스 코드 package main import ( "path/filepath" ) func findExtension(path string) string { ext := filepath.Ext(path) return ext } 테스트 코드 package main import ( "testing" "github.com/stretchr/testify/assert" ) func TestFindExtension(t *testing.T) { assert := assert.New(t) testPath := []string{"/go/src/txt.txt", "go/src/test.txt", "go/test1.t", "go/t.SM.. 2021. 7. 22. Go Lang - 배열과 문자열 2021. 7. 19. Go Lang - 모듈과 패키지 참고 테스트 자료 git https://github.com/3DPIT/golang/tree/master/0716/1.%20%EB%AA%A8%EB%93%88%EA%B3%BC%20%ED%8C%A8%ED%82%A4%EC%A7%80 3DPIT/golang Contribute to 3DPIT/golang development by creating an account on GitHub. github.com 2021. 7. 18. Go Lang - Interface Mock 만들기 2021. 7. 18. 이전 1 ··· 3 4 5 6 7 다음 728x90 반응형