cancel
Showing results for 
Search instead for 
Did you mean: 

How to use a newer Go version than 1.10?

jand
Member

How to use a newer Go version than 1.10?

I installed the WSL, Visual Studio Code, and are able to compile and run the sample go webserver application.

However, snapcraft automatically installs the golang-go system package, which is version 1.10.

Is there a way to use a newer version of Go, preferably one that supports go modules?

There seems to be a "go-channel" keyword for snapcraft 3.x, but I'm not sure how to update the WSL snapcraft which is only version 2.43...

4 REPLIES 4
CodeShepherd
Community Moderator

Re: How to use a newer Go version than 1.10?

Our system is build on Ubuntu core18.04 LTS, the default Go lang version is 1.10 for compatibility reason. If you like to install later verions see several guides on the internet.

The snapcraft version used actually is not updateable in WSL because the later versions are only available as a snap not as an apt package. Therefore an update would need some more effort/knowledge because the later snapcraft version are working with multipass or lxd containers for its building process only. And therefor a WSL2 would be necessary that this in untested until now. The other way is using a VM with a native ubuntu installed, like also mentioned in the SDK documentation.

See also some information about go applications in snaps provided by canonical.

jand
Member

Re: How to use a newer Go version than 1.10?

Thank you for your reply. I installed another Go version in WSL, but snapcraft still tried to download the system golang-go package with version 1.10 and use it for building the snap.

Initially I tried to get it working in the Ubuntu VM, but was not successful -- that's why I switched to WSL. Maybe I have to give it another try.

Is an update to core20 planned in the future?

CodeShepherd
Community Moderator

Re: How to use a newer Go version than 1.10?

Yes, it was planned for RM21.07 but I will have to check the actual state.

CodeShepherd
Community Moderator

Re: How to use a newer Go version than 1.10?

Latest info is that there are evaluations until RM20.11 we can tell you more then.

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist