Exhibit 14.2

CODE OF BUSINESS CONDUCT AND ETHICS



For: GSAM - BDCs 1

Effective Date: April 10, 2019

Revision History

Preamble

Pursuant to Section 406 of the Sarbanes-Oxley Act of 2002, the Securities and Exchange Commission (the SEC) has adopted rules requiring annual
disclosure of an investment companys code of ethics applicable to its principal executive, principal financial and principal accounting officers (the Covered Officers). Pursuant to Section 303A.10 of the NYSE Listed Company
Manual, the New York Stock Exchange, LLC (the NYSE) requires that a listed company adopt and disclose a code of business conduct and ethics for directors, officers and employees (collectively with the Covered Officers, the Covered
Persons). Goldman Sachs BDC, Inc. and other business development companies advised by Goldman Sachs Asset Management, L.P. (together, the GSAM BDCs) has adopted this Code of Business Conduct and Ethics (the Code)
pursuant to these rules.

1. Covered Persons/Purpose of Code

This Code applies to the Covered Persons of the Company for the purpose of promoting:



| |  |  | honest and ethical conduct, including the ethical handling of actual or apparent conflicts of interest between
personal and professional relationships;
| | - |  | -------------------------------------------------------------------------------------------------------------------------------------------------------



| |  |  | full, fair, accurate, timely and understandable disclosure in reports and documents that the Company files with,
or submits to, the SEC and the NYSE and in other public communications made by the Company;
| | - |  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



| |  |  | compliance with applicable laws and governmental rules and regulations;
| | - |  | -----------------------------------------------------------------------



| |  |  | the prompt internal reporting of violations of this Code to an appropriate person or persons identified herein;
and
| | - |  | -------------------------------------------------------------------------------------------------------------------



| |  |  | accountability for adherence to this Code.
| | - |  | ------------------------------------------

Each Covered Person owes a duty to the Company to adhere to a high standard of business ethics, and should be sensitive to situations that may give rise to
actual as well as apparent conflicts of interest. Each Covered Person should encourage his or her colleagues who provide services to the Company, whether directly or indirectly, to do the same.

2. Covered Persons Should Handle Ethically Actual and Apparent Conflicts of Interest

A conflict of interest occurs when a Covered Persons private interest interferes with the interests of, or his or her service to, the
Company. For example, a conflict of interest would arise if a Covered Person, or a member of his or her family, receives improper personal benefits as a result of his or her position with the Company.





|1 | BDC is defined as the Goldman Sachs BDC, Inc. and all other business development companies advised by Goldman
Sachs Asset Management, L.P.
|- | ------------------------------------------------------------------------------------------------------------------------------------------





|               |  |       
|-------------- |  | ------
|April 10, 2019 |  | Page 1



---

Code of Business Conduct and Ethics



Certain conflicts of interest covered by this Code arise out of the relationships
between Covered Persons and the Company and already are subject to conflict of interest provisions in the Investment Company Act of 1940 (the 1940 Act) and the Investment Advisers Act of 1940 (the Advisers Act). For example,
Covered Persons may not individually engage in certain transactions (such as the purchase or sale of securities or other property) with the Company. The compliance programs and procedures of the Company and its investment adviser and distributor (as
applicable) are designed to prevent, or identify and correct, violations of these provisions. This Code does not, and is not intended to, repeat or replace these programs and procedures.

Although typically not presenting an opportunity for improper personal benefit, conflicts arise from, or as a result of, the contractual relationship between
the Company and its investment adviser and distributor (as applicable), of which the Covered Persons are also officers or employees. As a result, this Code recognizes that the Covered Persons will, in the normal course of their duties, be involved
in establishing policies and implementing decisions which will have different effects on the investment adviser, the distributor (as applicable) and the Company. The participation of the Covered Persons in such activities is inherent in these
contractual relationships and is consistent with the performance by the Covered Persons of their duties as officers of the Company and, if addressed in conformity with the provisions of the 1940 Act and the Advisers Act, will be deemed to have been
handled ethically.

Other conflicts of interest are covered by this Code, even if such conflicts of interest are not subject to provisions in the 1940 Act
and the Advisers Act. Covered Persons should keep in mind that the following list of prohibitions does not cover every possible situation. The overarching principle  that the personal interest of a Covered Person should not be placed
improperly before the interest of the Company  should be the guiding principle in all circumstances.

Each Covered Person must:



| |  |  | not use his or her personal influence or personal relationships improperly to influence investment decisions or
financial reporting by the Company whereby the Covered Person would benefit personally to the detriment of the Company;
| | - |  | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



| |  |  | not cause the Company to take action, or fail to take action, for the individual personal benefit of the Covered
Person rather than the benefit of the Company; and
| | - |  | -------------------------------------------------------------------------------------------------------------------------------------------------------------------



| |  |  | not use material non-public knowledge of portfolio transactions made or
contemplated for the Company to profit personally or cause others to profit, by the market effect of such transactions.
| | - |  | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

In addition,
each Covered Officer must:



| |  |  | report at least annually his or her affiliations and other relationships as requested in the Companys
annual Directors and Officers Questionnaire.
| | - |  | ---------------------------------------------------------------------------------------------------------------------------------------------------

There are some conflict of interest situations that should be discussed with the Secretary
of the Company if material. Examples of these include:



| |  |  | any outside business activity that detracts from the ability of a Covered Person to devote appropriate time and
attention to his or her responsibilities as a Covered Person of the Company;
| | - |  | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------





|               |  |       
|-------------- |  | ------
|April 10, 2019 |  | Page 2



---

Code of Business Conduct and Ethics



| |  |  | the receipt of any non-nominal gifts related to the business of the
Company that may be inconsistent with any policy on gifts established by the Companys investment adviser and distributor (as applicable) from time to time; and
| | - |  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



| |  |  | a direct or indirect personal financial interest in commissions, transaction charges or spreads paid by the
Company for effecting portfolio transactions or for selling or redeeming shares other than an interest arising from the Covered Persons employment, such as compensation or equity ownership.
| | - |  | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

3. Fair Dealing

Each Covered Person must endeavor to
deal fairly with the Companys customers, suppliers and business partners, and any other companies or individuals with whom the Company does business or comes into contact, including fellow Covered Persons and the Companys competitors.
Each Covered Person must not take unfair advantage of these or other parties by means of:



| |  |  | manipulation;
| | - |  | -------------



| |  |  | concealment;
| | - |  | ------------



| |  |  | abuse of privileged information;
| | - |  | --------------------------------



| |  |  | misrepresentation of material facts; or
| | - |  | ---------------------------------------



| |  |  | any other unfair-dealing practice.
| | - |  | ----------------------------------

4. Protection and Proper Use of Company Assets

The
Companys assets are to be used only for legitimate business purposes. Each Covered Person should protect the Companys assets and ensure that they are used efficiently.

5. Corporate Opportunities

Each Covered Person has a
duty to advance the legitimate interests of the Company when the Opportunity presents itself. Therefore, each Covered person may not:



| |  |  | take for himself or herself personally opportunities, including investment opportunities, discovered through the
use of his or her position with the Company or its investment adviser, or through the use of eithers property or information;
| | - |  | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



| |  |  | use the Companys or its investment advisers property, information or position for his or her personal
gain or the gain of a family member; or
| | - |  | -----------------------------------------------------------------------------------------------------------------------------------------------



| |  |  | compete, or prepare to compete, with the Company or its investment adviser.
| | - |  | ---------------------------------------------------------------------------

6. Disclosure

Each Covered Person:



| |  |  | must familiarize himself or herself with the disclosure requirements applicable to the Company and its disclosure
controls and procedures;
| | - |  | ------------------------------------------------------------------------------------------------------------------------------------------



| |  |  | must not knowingly misrepresent, or cause others to misrepresent, facts about the Company to others, whether
within or outside the Company, including to the Companys directors and auditors, and to governmental regulators and self-regulatory organizations;
| | - |  | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------





|               |  |       
|-------------- |  | ------
|April 10, 2019 |  | Page 3



---

Code of Business Conduct and Ethics



| |  |  | should, to the extent appropriate within his area of responsibility, consult with other officers and employees of
the Company and its investment adviser and distributor and take other appropriate steps with the goal of promoting full, fair, accurate and timely disclosure in the reports and documents the Company files with, or submits to, the SEC and that are
signed or certified by him or her; and
| | - |  | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



| |  |  | must cooperate with the Companys independent accountants, regulatory agencies and internal auditors in
their review or inspection of the Company and its operations.
| | - |  | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------

7. Compliance

It is the responsibility of each Covered Person to otherwise promote adherence with the standards and restrictions imposed by applicable laws, rules and
regulations.

8. Reporting and Accountability

Each
Covered Person must:



| |  |  | upon adoption of this Code, affirm in writing that he or she has received and read this Code, and understands it;
| | - |  | -----------------------------------------------------------------------------------------------------------------



| |  |  | annually thereafter affirm that he or she has complied with the requirements of this Code;
| | - |  | ------------------------------------------------------------------------------------------



| |  |  | not retaliate against any person for reports of potential violations that are made in good faith; and
| | - |  | -----------------------------------------------------------------------------------------------------



| |  |  | notify the Secretary of the Company promptly if he or she knows of any violation of this Code. Failure to do so
is itself a violation of this Code; and
| | - |  | -------------------------------------------------------------------------------------------------------------------------------------------------------



| |  |  | Report promptly any changes in his or her affiliations.
| | - |  | -------------------------------------------------------

The Secretary of the Company is responsible for applying this Code to specific situations in which questions are presented under it and has the authority to
interpret this Code in any particular situation.

9. Investigations and Enforcements

The Company will follow these procedures in investigating and enforcing this Code:



| |  |  | the Secretary of the Company will take all appropriate action to investigate any violations and potential
violations reported to him or her;
| | - |  | --------------------------------------------------------------------------------------------------------------------------------------------



| |  |  | violations will be reported to the Board of Directors of the Company (the Board) after such
investigation;
| | - |  | ------------------------------------------------------------------------------------------------------------



| |  |  | if the Board determines that a violation has occurred, it will consider appropriate action, which may, without
limitation, include review of, and appropriate modifications to, applicable policies and procedures; notification to appropriate personnel of the investment adviser, distributor or their respective boards; or recommendation of the dismissal of the
Covered Person;
| | - |  | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



| |  |  | the Board will be responsible for granting waivers, as appropriate; and
| | - |  | -----------------------------------------------------------------------



| |  |  | any changes to or waivers of this Code will, to the extent required, be disclosed as provided by SEC rules.
| | - |  | -----------------------------------------------------------------------------------------------------------





|               |  |       
|-------------- |  | ------
|April 10, 2019 |  | Page 4



---

Code of Business Conduct and Ethics



10. Other Policies and Procedures

The Companys and its investment advisers and distributors (as applicable) codes of ethics under Rule
17j-1 under the 1940 Act are separate requirements applying to the Covered Persons and others, and are not part of this Code.

11. Amendments

This Code may not be amended except in
written form, which is specifically approved or ratified by the Board.

12. Confidentiality

Covered Persons must not disclose confidential information regarding the Company, its investment adviser or their affiliates, unless such disclosure is
authorized or required by law. Confidential information includes all non-public information that may be harmful to, or useful to the competitors of, the Company, its investment adviser or their affiliates.
Also, all reports and records prepared or maintained pursuant to this Code will be considered confidential and will be maintained and protected accordingly. Except as otherwise required by law or this Code, such matters will not be disclosed to
anyone other than the Board, the Companys investment adviser and distributor (as applicable), and their respective counsel.

13 . Internal Use

This Code is intended solely for the internal use by the Company. This Code is a statement of certain fundamental principles, policies and procedures
that govern the Covered Persons in the conduct of the Companys business. It is not intended to and does not create any rights in any employee, investor, supplier, competitor, shareholder or any other person.

Revision History



| |  |  | April 10, 2019 (revised for formatting)
| | - |  | ---------------------------------------



| |  |  | April 11, 2016 (revised to apply to all GSAM BDCs)
| | - |  | --------------------------------------------------



| |  |  | March 17, 2015 (Adopted)
| | - |  | ------------------------





|               |  |       
|-------------- |  | ------
|April 10, 2019 |  | Page 5