본문 바로가기
Go

GoLand : import한 패키지의 내용이 Unresolved될 때 해결 방법

by weero 2023. 4. 12.

 

import한 패키지를 사용했을 때 Unresolved 표시가 되는 현상이 있었다.

 

ex.

computepb "cloud.google.com/go/compute/apiv1/computepb"

위 패키지를 사용한 computepb.Instance 구조체에서 Unresolved 표시

 

ex.

 

 

동료분이 공유해주신 원인은 패키지 파일이 너무 커서 인덱싱을 해오지 못해 그런 것이라고 한다.

GoLand를 완전히 기본 설정으로 사용하고 있는 중이었고 GoLand 설정을 통해 해결할 수 있었다.

 

1. GoLand 상단 Help > Edit Custom Properties...  클릭

 

2. 아래처럼 idea.properties 파일이 새로 뜨면 아래처럼 입력해주면 된다.

#---------------------------------------------------------------------
# Maximum file size (kilobytes) IDE should provide code assistance for.
# The larger file is the slower its editor works and higher overall system memory requirements are
# if code assistance is enabled. Remove this property or set to very large number if you need
# code assistance for any files available regardless their size.
#---------------------------------------------------------------------
idea.max.intellisense.filesize=40000

#---------------------------------------------------------------------
# Maximum file size (kilobytes) IDE is able to open.
#---------------------------------------------------------------------
idea.max.content.load.filesize=20000

 

3. GoLand 상단 메뉴 File > Invalidate Caches > Invalidate and Restart

 

 

 

이제 안뜸